Chromium Code Reviews| Index: chrome/browser/extensions/extension_host.h |
| diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h |
| index ede9387037e4ac727eeef25c7e803097172ef934..ed94325845bad220c80faaf84a8bb99a34fba1ce 100644 |
| --- a/chrome/browser/extensions/extension_host.h |
| +++ b/chrome/browser/extensions/extension_host.h |
| @@ -52,6 +52,19 @@ class ExtensionHost : public content::WebContentsDelegate, |
| public ExtensionFunctionDispatcher::Delegate, |
| public content::NotificationObserver { |
| public: |
| + // Any behavior that is different for different types of background hosts |
| + // should go in ExtensionHost::Delegate. ExtensionHost::Delegate is not |
| + // abstract, this class provides the default behavior. |
| + class Delegate { |
|
Yoyo Zhou
2012/10/30 01:35:22
As we discussed, this delegate feels like more com
benwells
2012/10/30 02:55:23
I agree with your comments. I don't like passing t
Aaron Boodman
2012/10/30 05:30:08
This sounds like a good plan to me!
|
| + public: |
| + Delegate() {} |
| + virtual ~Delegate() {} |
| + |
| + // True if the browser process should be kept alive while this extension |
| + // host is active. |
| + virtual bool KeepsBrowserProcessAlive(); |
| + }; |
| + |
| class ProcessCreationQueue; |
| #if defined(TOOLKIT_VIEWS) |
| @@ -65,7 +78,9 @@ class ExtensionHost : public content::WebContentsDelegate, |
| typedef ExtensionViewAndroid PlatformExtensionView; |
| #endif |
| + // The ExtensionHost will take ownership of |delegate|. |
| ExtensionHost(const Extension* extension, |
| + Delegate* delegate, |
| content::SiteInstance* site_instance, |
| const GURL& url, chrome::ViewType host_type); |
| virtual ~ExtensionHost(); |
| @@ -219,6 +234,9 @@ class ExtensionHost : public content::WebContentsDelegate, |
| // The profile that this host is tied to. |
| Profile* profile_; |
| + // The delegate for this host. |
| + scoped_ptr<Delegate> delegate_; |
| + |
| // Optional view that shows the rendered content in the UI. |
| scoped_ptr<PlatformExtensionView> view_; |