diff options
author | Steve Block <steveblock@google.com> | 2009-12-15 10:12:09 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-12-17 17:41:10 +0000 |
commit | 643ca7872b450ea4efacab6188849e5aac2ba161 (patch) | |
tree | 6982576c228bcd1a7efe98afed544d840751094c /WebKit/mac/Plugins/WebBaseNetscapePluginView.mm | |
parent | d026980fde6eb3b01c1fe49441174e89cd1be298 (diff) | |
download | external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2 |
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebKit/mac/Plugins/WebBaseNetscapePluginView.mm')
-rw-r--r-- | WebKit/mac/Plugins/WebBaseNetscapePluginView.mm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index 0b4d56a..bf8b80b 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -64,6 +64,8 @@ #define LoginWindowDidSwitchFromUserNotification @"WebLoginWindowDidSwitchFromUserNotification" #define LoginWindowDidSwitchToUserNotification @"WebLoginWindowDidSwitchToUserNotification" +static const NSTimeInterval ClearSubstituteImageDelay = 0.5; + using namespace WebCore; class WebHaltablePlugin : public HaltablePlugin { @@ -77,6 +79,8 @@ private: virtual void halt(); virtual void restart(); virtual Node* node() const; + virtual bool isWindowed() const; + virtual String pluginName() const; WebBaseNetscapePluginView* m_view; }; @@ -96,6 +100,16 @@ Node* WebHaltablePlugin::node() const return [m_view element]; } +bool WebHaltablePlugin::isWindowed() const +{ + return false; +} + +String WebHaltablePlugin::pluginName() const +{ + return [[m_view pluginPackage] name]; +} + @implementation WebBaseNetscapePluginView + (void)initialize @@ -498,6 +512,19 @@ Node* WebHaltablePlugin::node() const _hasBeenHalted = YES; } +- (void)_clearSubstituteImage +{ + Element* element = [self element]; + if (!element) + return; + + RenderObject* renderer = element->renderer(); + if (!renderer) + return; + + toRenderWidget(renderer)->showSubstituteImage(0); +} + - (void)resumeFromHalt { ASSERT(_isHalted); @@ -508,7 +535,9 @@ Node* WebHaltablePlugin::node() const _isHalted = NO; ASSERT([self element]->renderer()); - toRenderWidget([self element]->renderer())->showSubstituteImage(0); + // FIXME 7417484: This is a workaround for plug-ins not drawing immediately. We'd like to detect when the + // plug-in actually draws instead of just assuming it will do so within 0.5 seconds of being restarted. + [self performSelector:@selector(_clearSubstituteImage) withObject:nil afterDelay:ClearSubstituteImageDelay]; } - (BOOL)isHalted |