Index: chrome/browser/extensions/extension_host.h |
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h |
index 60d2955e228c6701000f239d877dfe62db561c70..cc4d44118f8b7bbc08eb5b18d8ab26f7c271c249 100644 |
--- a/chrome/browser/extensions/extension_host.h |
+++ b/chrome/browser/extensions/extension_host.h |
@@ -12,6 +12,7 @@ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/perftimer.h" |
+#include "chrome/browser/extensions/base_extension_host.h" |
#include "chrome/browser/extensions/extension_function_dispatcher.h" |
#include "content/public/browser/javascript_dialogs.h" |
#include "content/public/browser/notification_observer.h" |
@@ -20,16 +21,6 @@ |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/common/view_type.h" |
-#if defined(TOOLKIT_VIEWS) |
-#include "chrome/browser/ui/views/extensions/extension_view.h" |
-#elif defined(OS_MACOSX) |
-#include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
-#elif defined(TOOLKIT_GTK) |
-#include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
-#elif defined(OS_ANDROID) |
-#include "chrome/browser/ui/android/extensions/extension_view_android.h" |
-#endif |
- |
class Browser; |
class Extension; |
class PrefsTabHelper; |
@@ -44,61 +35,24 @@ class SiteInstance; |
// It handles setting up the renderer process, if needed, with special |
// privileges available to extensions. It may have a view to be shown in the |
// browser UI, or it may be hidden. |
-class ExtensionHost : public content::WebContentsDelegate, |
+class ExtensionHost : public BaseExtensionHost, |
+ public content::WebContentsDelegate, |
public content::WebContentsObserver, |
public ExtensionFunctionDispatcher::Delegate, |
public content::NotificationObserver { |
public: |
class ProcessCreationQueue; |
-#if defined(TOOLKIT_VIEWS) |
- typedef ExtensionView PlatformExtensionView; |
-#elif defined(OS_MACOSX) |
- typedef ExtensionViewMac PlatformExtensionView; |
-#elif defined(TOOLKIT_GTK) |
- typedef ExtensionViewGtk PlatformExtensionView; |
-#elif defined(OS_ANDROID) |
- // Android does not support extensions. |
- typedef ExtensionViewAndroid PlatformExtensionView; |
-#endif |
- |
ExtensionHost(const Extension* extension, |
content::SiteInstance* site_instance, |
const GURL& url, content::ViewType host_type); |
virtual ~ExtensionHost(); |
-#if defined(TOOLKIT_VIEWS) |
- void set_view(PlatformExtensionView* view) { view_.reset(view); } |
-#endif |
- |
- const PlatformExtensionView* view() const { |
-#if defined(OS_ANDROID) |
- NOTREACHED(); |
-#endif |
- return view_.get(); |
- } |
- |
- PlatformExtensionView* view() { |
-#if defined(OS_ANDROID) |
- NOTREACHED(); |
-#endif |
- return view_.get(); |
- } |
- |
- // Create an ExtensionView and tie it to this host and |browser|. Note NULL |
- // is a valid argument for |browser|. Extension views may be bound to |
- // tab-contents hosted in ExternalTabContainer objects, which do not |
- // instantiate Browser objects. |
- void CreateView(Browser* browser); |
- |
- // Helper variant of the above for cases where no Browser is present. |
- void CreateViewWithoutBrowser(); |
- |
const Extension* extension() const { return extension_; } |
const std::string& extension_id() const { return extension_id_; } |
- content::WebContents* host_contents() const { return host_contents_.get(); } |
- content::RenderViewHost* render_view_host() const; |
- content::RenderProcessHost* render_process_host() const; |
+ virtual content::WebContents* host_contents() const OVERRIDE; |
+ virtual content::RenderViewHost* render_view_host() const OVERRIDE; |
+ virtual content::RenderProcessHost* render_process_host() const OVERRIDE; |
bool did_stop_loading() const { return did_stop_loading_; } |
bool document_element_available() const { |
return document_element_available_; |
@@ -106,7 +60,7 @@ class ExtensionHost : public content::WebContentsDelegate, |
Profile* profile() const { return profile_; } |
- content::ViewType extension_host_type() const { return extension_host_type_; } |
+ virtual content::ViewType extension_host_type() const OVERRIDE; |
const GURL& GetURL() const; |
// ExtensionFunctionDispatcher::Delegate |
@@ -162,7 +116,6 @@ class ExtensionHost : public content::WebContentsDelegate, |
const gfx::Rect& initial_pos, |
bool user_gesture) OVERRIDE; |
virtual void CloseContents(content::WebContents* contents) OVERRIDE; |
- virtual bool ShouldSuppressDialogs() OVERRIDE; |
// content::NotificationObserver |
virtual void Observe(int type, |
@@ -208,9 +161,6 @@ class ExtensionHost : public content::WebContentsDelegate, |
// The profile that this host is tied to. |
Profile* profile_; |
- // Optional view that shows the rendered content in the UI. |
- scoped_ptr<PlatformExtensionView> view_; |
- |
// Used to create dialog boxes. |
// It must outlive host_contents_ as host_contents_ will access it |
// during destruction. |