summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-20 00:27:44 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-20 00:27:44 +0000
commit3fc07c5701fa6fdd4c7ed86b935458cece8eacf7 (patch)
tree0787f38f50add4a178358c1f910c3f3fad9fda36 /content
parent4e87da9fcc4a9735c06b71314421651d020995ec (diff)
downloadchromium_src-3fc07c5701fa6fdd4c7ed86b935458cece8eacf7.zip
chromium_src-3fc07c5701fa6fdd4c7ed86b935458cece8eacf7.tar.gz
chromium_src-3fc07c5701fa6fdd4c7ed86b935458cece8eacf7.tar.bz2
Move CrashedPlugin() and PluginHungStatusChanged() from WebContentsDelegate into WebContentsObserver, and implement them in PluginObserver and HungPluginTabHelper.
This removes some code from Browser that only forwarded to other helpers. BUG=none TEST=none Review URL: http://codereview.chromium.org/10117025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/web_contents/web_contents_impl.cc7
-rw-r--r--content/public/browser/web_contents_delegate.h15
-rw-r--r--content/public/browser/web_contents_observer.h13
3 files changed, 17 insertions, 18 deletions
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 32560b3..928b7c1 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1737,7 +1737,8 @@ void WebContentsImpl::OnFindReply(int request_id,
}
void WebContentsImpl::OnCrashedPlugin(const FilePath& plugin_path) {
- delegate_->CrashedPlugin(this, plugin_path);
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ PluginCrashed(plugin_path));
}
void WebContentsImpl::OnAppCacheAccessed(const GURL& manifest_url,
@@ -1768,8 +1769,8 @@ void WebContentsImpl::OnSetSelectedColorInColorChooser(int color_chooser_id,
void WebContentsImpl::OnPepperPluginHung(int plugin_child_id,
const FilePath& path,
bool is_hung) {
- if (delegate_)
- delegate_->PluginHungStatusChanged(this, plugin_child_id, path, is_hung);
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_,
+ PluginHungStatusChanged(plugin_child_id, path, is_hung));
}
// This exists for render views that don't have a WebUI, but do have WebUI
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 922b995..569d1ec 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -374,21 +374,6 @@ class CONTENT_EXPORT WebContentsDelegate {
int active_match_ordinal,
bool final_update) {}
- // Notification that a plugin has crashed.
- virtual void CrashedPlugin(WebContents* web_contents,
- const FilePath& plugin_path) {}
-
- // Notication that the given plugin has hung or become unhung. This
- // notification is only for Pepper plugins.
- //
- // The plugin_child_id is the unique child process ID from the plugin. Note
- // that this ID is supplied by the renderer, so should be validated before
- // it's used for anything in case there's an exploited renderer.
- virtual void PluginHungStatusChanged(WebContents* web_contents,
- int plugin_child_id,
- const FilePath& plugin_path,
- bool is_hung) {}
-
// Invoked when the preferred size of the contents has been changed.
virtual void UpdatePreferredSize(WebContents* web_contents,
const gfx::Size& pref_size) {}
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index e3db1f1..b0b77a8 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -93,6 +93,19 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Channel::Listener,
virtual void AppCacheAccessed(const GURL& manifest_url,
bool blocked_by_policy) {}
+ // Notification that a plugin has crashed.
+ virtual void PluginCrashed(const FilePath& plugin_path) {}
+
+ // Notication that the given plugin has hung or become unhung. This
+ // notification is only for Pepper plugins.
+ //
+ // The plugin_child_id is the unique child process ID from the plugin. Note
+ // that this ID is supplied by the renderer, so should be validated before
+ // it's used for anything in case there's an exploited renderer.
+ virtual void PluginHungStatusChanged(int plugin_child_id,
+ const FilePath& plugin_path,
+ bool is_hung) {}
+
// Invoked when the WebContents is being destroyed. Gives subclasses a chance
// to cleanup. At the time this is invoked |web_contents()| returns NULL.
// It is safe to delete 'this' from here.