Chromium Code Reviews| Index: chrome/browser/plugins/plugin_observer.h |
| diff --git a/chrome/browser/plugins/plugin_observer.h b/chrome/browser/plugins/plugin_observer.h |
| index d2d6e114ba517cd2b5cc629f5847a545b9272727..d5116bbea0973701f8610b6c89e6e6d02aa49008 100644 |
| --- a/chrome/browser/plugins/plugin_observer.h |
| +++ b/chrome/browser/plugins/plugin_observer.h |
| @@ -6,6 +6,7 @@ |
| #define CHROME_BROWSER_PLUGINS_PLUGIN_OBSERVER_H_ |
| #include "base/memory/weak_ptr.h" |
| +#include "chrome/browser/tab_contents/web_contents_user_data.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #if defined(ENABLE_PLUGIN_INSTALLATION) |
| @@ -15,16 +16,19 @@ |
| class GURL; |
| class InfoBarDelegate; |
| class PluginFinder; |
| -class TabContents; |
| #if defined(ENABLE_PLUGIN_INSTALLATION) |
| class PluginInstaller; |
| class PluginPlaceholderHost; |
| #endif |
| -class PluginObserver : public content::WebContentsObserver { |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +class PluginObserver : public content::WebContentsObserver, |
| + public WebContentsUserData<PluginObserver> { |
| public: |
| - explicit PluginObserver(TabContents* tab_contents); |
| virtual ~PluginObserver(); |
| // content::WebContentsObserver implementation. |
| @@ -35,9 +39,13 @@ class PluginObserver : public content::WebContentsObserver { |
| void InstallMissingPlugin(PluginInstaller* installer); |
| #endif |
| - TabContents* tab_contents() { return tab_contents_; } |
| + using content::WebContentsObserver::web_contents; |
|
Bernhard Bauer
2012/09/24 08:55:18
Nit: Could you add a comment to explain that we're
Avi (use Gerrit)
2012/09/24 15:27:51
I'm killing TabContents (see the referenced bug) s
|
| private: |
| + explicit PluginObserver(content::WebContents* web_contents); |
|
Bernhard Bauer
2012/09/24 08:55:18
Nit: I think the constructor declaration should co
|
| + static int kUserDataKey; |
| + friend class WebContentsUserData<PluginObserver>; |
| + |
| class PluginPlaceholderHost; |
| void OnBlockedUnauthorizedPlugin(const string16& name, |
| @@ -60,8 +68,6 @@ class PluginObserver : public content::WebContentsObserver { |
| base::WeakPtrFactory<PluginObserver> weak_ptr_factory_; |
| - TabContents* tab_contents_; |
| - |
| #if defined(ENABLE_PLUGIN_INSTALLATION) |
| // Stores all PluginPlaceholderHosts, keyed by their routing ID. |
| std::map<int, PluginPlaceholderHost*> plugin_placeholders_; |