| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 11 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 11 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 12 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 12 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
| 13 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 13 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
| 14 #if defined(TOOLKIT_VIEWS) | 14 #if defined(TOOLKIT_VIEWS) |
| 15 #include "chrome/browser/views/extensions/extension_view.h" | 15 #include "chrome/browser/views/extensions/extension_view.h" |
| 16 #elif defined(OS_LINUX) | 16 #elif defined(USE_X11) |
| 17 #include "chrome/browser/gtk/extension_view_gtk.h" | 17 #include "chrome/browser/gtk/extension_view_gtk.h" |
| 18 #endif | 18 #endif |
| 19 #include "chrome/common/notification_registrar.h" | 19 #include "chrome/common/notification_registrar.h" |
| 20 | 20 |
| 21 class Browser; | 21 class Browser; |
| 22 class Extension; | 22 class Extension; |
| 23 class ExtensionProcessManager; | 23 class ExtensionProcessManager; |
| 24 class RenderProcessHost; | 24 class RenderProcessHost; |
| 25 class RenderWidgetHost; | 25 class RenderWidgetHost; |
| 26 class RenderWidgetHostView; | 26 class RenderWidgetHostView; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 39 // Enable DOM automation in created render view hosts. | 39 // Enable DOM automation in created render view hosts. |
| 40 static void EnableDOMAutomation() { enable_dom_automation_ = true; } | 40 static void EnableDOMAutomation() { enable_dom_automation_ = true; } |
| 41 | 41 |
| 42 ExtensionHost(Extension* extension, SiteInstance* site_instance, | 42 ExtensionHost(Extension* extension, SiteInstance* site_instance, |
| 43 const GURL& url, ViewType::Type host_type); | 43 const GURL& url, ViewType::Type host_type); |
| 44 ~ExtensionHost(); | 44 ~ExtensionHost(); |
| 45 | 45 |
| 46 #if defined(TOOLKIT_VIEWS) | 46 #if defined(TOOLKIT_VIEWS) |
| 47 void set_view(ExtensionView* view) { view_.reset(view); } | 47 void set_view(ExtensionView* view) { view_.reset(view); } |
| 48 ExtensionView* view() const { return view_.get(); } | 48 ExtensionView* view() const { return view_.get(); } |
| 49 #elif defined(OS_LINUX) | 49 #elif defined(USE_X11) |
| 50 ExtensionViewGtk* view() const { return view_.get(); } | 50 ExtensionViewGtk* view() const { return view_.get(); } |
| 51 #else | 51 #else |
| 52 // TODO(port): implement | 52 // TODO(port): implement |
| 53 void* view() const { return NULL; } | 53 void* view() const { return NULL; } |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 // Create an ExtensionView and tie it to this host and |browser|. | 56 // Create an ExtensionView and tie it to this host and |browser|. |
| 57 void CreateView(Browser* browser); | 57 void CreateView(Browser* browser); |
| 58 | 58 |
| 59 Extension* extension() { return extension_; } | 59 Extension* extension() { return extension_; } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 // The extension that we're hosting in this view. | 147 // The extension that we're hosting in this view. |
| 148 Extension* extension_; | 148 Extension* extension_; |
| 149 | 149 |
| 150 // The profile that this host is tied to. | 150 // The profile that this host is tied to. |
| 151 Profile* profile_; | 151 Profile* profile_; |
| 152 | 152 |
| 153 // Optional view that shows the rendered content in the UI. | 153 // Optional view that shows the rendered content in the UI. |
| 154 #if defined(TOOLKIT_VIEWS) | 154 #if defined(TOOLKIT_VIEWS) |
| 155 scoped_ptr<ExtensionView> view_; | 155 scoped_ptr<ExtensionView> view_; |
| 156 #elif defined(OS_LINUX) | 156 #elif defined(USE_X11) |
| 157 scoped_ptr<ExtensionViewGtk> view_; | 157 scoped_ptr<ExtensionViewGtk> view_; |
| 158 #endif | 158 #endif |
| 159 | 159 |
| 160 // The host for our HTML content. | 160 // The host for our HTML content. |
| 161 RenderViewHost* render_view_host_; | 161 RenderViewHost* render_view_host_; |
| 162 | 162 |
| 163 // Common implementations of some RenderViewHostDelegate::View methods. | 163 // Common implementations of some RenderViewHostDelegate::View methods. |
| 164 RenderViewHostDelegateViewHelper delegate_view_helper_; | 164 RenderViewHostDelegateViewHelper delegate_view_helper_; |
| 165 | 165 |
| 166 // Whether the RenderWidget has reported that it has stopped loading. | 166 // Whether the RenderWidget has reported that it has stopped loading. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 177 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; | 177 scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; |
| 178 | 178 |
| 179 // Only EXTENSION_TOOLSTRIP and EXTENSION_BACKGROUND_PAGE are used here, | 179 // Only EXTENSION_TOOLSTRIP and EXTENSION_BACKGROUND_PAGE are used here, |
| 180 // others are not hostd by ExtensionHost. | 180 // others are not hostd by ExtensionHost. |
| 181 ViewType::Type extension_host_type_; | 181 ViewType::Type extension_host_type_; |
| 182 | 182 |
| 183 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 183 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 186 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |