WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jun 2006 17:55:00 +0000 (17:55 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jun 2006 17:55:00 +0000 (17:55 +0000)
2006-06-06  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by John.

        * bridge/mac/WebCoreFrameBridge.h:
        * bridge/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge containsPlugins]):
        * page/Frame.cpp:
        (WebCore::Frame::containsPlugins):
        * page/Frame.h:
        Add containsPlugins function which returns whether a frame contains plugins
        or not.

WebKit:

2006-06-06  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by John.

        * WebView/WebFrame.m:
        (-[WebFrame _reloadForPluginChanges]):
        Don't traverse the view hierarchy looking for plugin views. Instead, just
        ask the frame whether it contains any plugins.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/mac/WebCoreFrameBridge.h
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebKit/ChangeLog
WebKit/WebView/WebFrame.m

index e9db6b0ac736e95c7904cfadc729217b985ccc47..2c094ae967d5ed4ee249c8a5e876d42eca28c5bd 100644 (file)
@@ -1,3 +1,16 @@
+2006-06-06  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by John.
+
+        * bridge/mac/WebCoreFrameBridge.h:
+        * bridge/mac/WebCoreFrameBridge.mm:
+        (-[WebCoreFrameBridge containsPlugins]):
+        * page/Frame.cpp:
+        (WebCore::Frame::containsPlugins):
+        * page/Frame.h:
+        Add containsPlugins function which returns whether a frame contains plugins
+        or not.
+
 2006-06-05  Rob Buis  <buis@kde.org>
 
         Reviewed by mjs.
index 22acd4fdd515a7cb10ebe3c0d211f0df51a6c433..773cc60bd94fc092d94e1ae8e023876c44e7900a 100644 (file)
@@ -489,6 +489,7 @@ typedef enum {
 
 - (BOOL)canProvideDocumentSource;
 - (BOOL)canSaveAsWebArchive;
+- (BOOL)containsPlugins;
 @end
 
 // The WebCoreFrameBridge protocol contains methods for use by the WebCore side of the bridge.
index b98e5d367dfdea19216cec9f10170691e0a9e042..d55ff31c330a9cf0c50fce4acdebb60ff52ab799 100644 (file)
@@ -2566,6 +2566,11 @@ static NSCharacterSet *_getPostSmartSet(void)
     return [self canProvideDocumentSource];
 }
 
+- (BOOL)containsPlugins
+{
+    return m_frame->containsPlugins();
+}
+
 @end
 
 @implementation WebCoreFrameBridge (WebCoreBridgeInternal)
index 3f6c082d54e3e9a6f467eb0d96a4755615cffba5..48802067ae949158e0a456e62e103748df8b8c06 100644 (file)
@@ -3470,5 +3470,9 @@ String Frame::documentTypeString() const
     return String();
 }
 
+bool Frame::containsPlugins() const 
+{ 
+    return d->m_plugins.size() != 0;
+}
 
 } // namespace WebCore
index ed858168703236e6e5e09d6b050ece0cbad146f9..6cedc0d4210a8242192ec542064b1a94088a70fb 100644 (file)
@@ -788,6 +788,8 @@ public:
   void setResourceRequest(const ResourceRequest& request);
   const ResourceRequest& resourceRequest() const;
 
+  bool containsPlugins() const;
+  
   // split out controller objects
   FrameTree* tree() const;
   SelectionController& selection() const; // FIXME: Change to pointer?
index 453ca457f07bcf8f6b01e7f3c7aa3108fac0bdfb..e60745d35ce88c4fd086482da0a3806c2fdaaa94 100644 (file)
@@ -1,3 +1,12 @@
+2006-06-06  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by John.
+
+        * WebView/WebFrame.m:
+        (-[WebFrame _reloadForPluginChanges]):
+        Don't traverse the view hierarchy looking for plugin views. Instead, just
+        ask the frame whether it contains any plugins.
+
 2006-06-03  Steve Falkenburg  <sfalken@apple.com>
 
         Reviewed by hyatt.
index 1e85337276c9680c9aebf6e8de4b4c9bc0bac8e1..d66b3dcc9c7814390dc880bd87408184597a47e1 100644 (file)
@@ -2431,22 +2431,9 @@ static CFAbsoluteTime _timeOfLastCompletedLoad;
     for (WebFrame *frame = self; frame; frame = [frame _traverseNextFrameStayWithin:self]) {
         NSView <WebDocumentView> *documentView = [[frame frameView] documentView];
         if ([documentView isKindOfClass:[WebNetscapePluginDocumentView class]] ||
-            [documentView isKindOfClass:[WebPluginDocumentView class]]) {
+            [documentView isKindOfClass:[WebPluginDocumentView class]] ||
+            ([documentView isKindOfClass:[WebHTMLView class]] && [_private->bridge containsPlugins]))
             [frame reload];
-        } else if ([documentView isKindOfClass:[WebHTMLView class]]) {
-            NSEnumerator *viewEnumerator = [[documentView subviews] objectEnumerator];
-            NSView *view;
-            // FIXME:  We should ask the frame if it contains plugins, rather
-            // than doing this check.
-            while ((view = [viewEnumerator nextObject]) != nil) {
-                if ([view isKindOfClass:[WebNetscapePluginEmbeddedView class]] ||
-                    [view isKindOfClass:[WebNullPluginView class]] ||
-                    [WebPluginController isPlugInView:view]) {
-                    [frame reload];
-                    break;
-                }
-            }
-        }
     }
 }