Chromium Code Reviews| 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 6cf1a395a86f55ca1a1b4ab39cad98ea133ceec7..1a64b78f3675d49a6f0fcfbf2fe94799b5817e6c 100644 |
| --- a/chrome/browser/ui/hung_plugin_tab_helper.h |
| +++ b/chrome/browser/ui/hung_plugin_tab_helper.h |
| @@ -11,8 +11,7 @@ |
| #include "base/strings/string16.h" |
| #include "base/time/time.h" |
| #include "base/timer/timer.h" |
| -#include "content/public/browser/notification_observer.h" |
| -#include "content/public/browser/notification_registrar.h" |
| +#include "components/infobars/core/infobar_manager.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/browser/web_contents_user_data.h" |
| @@ -37,8 +36,8 @@ class InfoBarDelegate; |
| // - Hide the infobar if the plugin starts responding again. |
| // - Keep track of all of this for any number of plugins. |
| class HungPluginTabHelper |
| - : public content::WebContentsObserver, |
| - public content::NotificationObserver, |
| + : public infobars::InfoBarManager::Observer, |
| + public content::WebContentsObserver, |
| public content::WebContentsUserData<HungPluginTabHelper> { |
| public: |
| virtual ~HungPluginTabHelper(); |
| @@ -50,11 +49,6 @@ class HungPluginTabHelper |
| 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); |
| @@ -77,11 +71,18 @@ class HungPluginTabHelper |
| // be called even if the bar is not opened, in which case it will do nothing. |
| void CloseBar(PluginState* state); |
| - content::NotificationRegistrar registrar_; |
| + // infobars::InfoBarManager::Observer: |
| + virtual void OnInfoBarRemoved(infobars::InfoBar* infobar, |
| + bool animate) OVERRIDE; |
| + virtual void OnManagerShuttingDown( |
| + infobars::InfoBarManager* manager) OVERRIDE; |
| // All currently hung plugins. |
| PluginStateMap hung_plugins_; |
| + // The number of infobars we are observing. |
|
Peter Kasting
2014/05/31 03:44:59
Nit: We don't actually observe infobars, so how ab
tfarina
2014/06/03 03:47:13
Done.
|
| + int number_of_infobars_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(HungPluginTabHelper); |
| }; |