Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: chrome/browser/ui/hung_plugin_tab_helper.h

Issue 338353003: Revert of Change HungPluginTabHelper to listen for infobar changes through Observer style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/hung_plugin_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/hung_plugin_tab_helper.h
diff --git a/chrome/browser/ui/hung_plugin_tab_helper.h b/chrome/browser/ui/hung_plugin_tab_helper.h
index b71eeb73508ee778e949939423074b446fb40d57..6cf1a395a86f55ca1a1b4ab39cad98ea133ceec7 100644
--- a/chrome/browser/ui/hung_plugin_tab_helper.h
+++ b/chrome/browser/ui/hung_plugin_tab_helper.h
@@ -11,7 +11,8 @@
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "components/infobars/core/infobar_manager.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -36,8 +37,8 @@
// - Hide the infobar if the plugin starts responding again.
// - Keep track of all of this for any number of plugins.
class HungPluginTabHelper
- : public infobars::InfoBarManager::Observer,
- public content::WebContentsObserver,
+ : public content::WebContentsObserver,
+ public content::NotificationObserver,
public content::WebContentsUserData<HungPluginTabHelper> {
public:
virtual ~HungPluginTabHelper();
@@ -48,6 +49,11 @@
virtual void PluginHungStatusChanged(int plugin_child_id,
const base::FilePath& plugin_path,
bool is_hung) OVERRIDE;
+
+ // content::NotificationObserver:
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
// Called by an infobar when the user selects to kill the plugin.
void KillPlugin(int child_id);
@@ -71,16 +77,10 @@
// be called even if the bar is not opened, in which case it will do nothing.
void CloseBar(PluginState* state);
- // infobars::InfoBarManager::Observer:
- virtual void OnInfoBarRemoved(infobars::InfoBar* infobar,
- bool animate) OVERRIDE;
+ content::NotificationRegistrar registrar_;
// All currently hung plugins.
PluginStateMap hung_plugins_;
-
- // The number of hung plugin infobars open. We use this to determine when we
- // should remove ourself as an observer of InfoBarManager notifications.
- int number_of_infobars_;
DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper);
};
« no previous file with comments | « no previous file | chrome/browser/ui/hung_plugin_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698