OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #if defined(TOOLKIT_VIEWS) | 22 #if defined(TOOLKIT_VIEWS) |
23 #include "chrome/browser/ui/views/extensions/extension_view.h" | 23 #include "chrome/browser/ui/views/extensions/extension_view.h" |
24 #elif defined(OS_MACOSX) | 24 #elif defined(OS_MACOSX) |
25 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 25 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
26 #elif defined(TOOLKIT_GTK) | 26 #elif defined(TOOLKIT_GTK) |
27 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" | 27 #include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h" |
28 #endif | 28 #endif |
29 | 29 |
30 class Browser; | 30 class Browser; |
31 class Extension; | 31 class Extension; |
32 class RenderProcessHost; | |
33 class RenderWidgetHostView; | 32 class RenderWidgetHostView; |
34 class TabContents; | 33 class TabContents; |
35 struct ViewHostMsg_RunFileChooser_Params; | 34 struct ViewHostMsg_RunFileChooser_Params; |
36 struct WebPreferences; | 35 struct WebPreferences; |
37 | 36 |
| 37 namespace content { |
| 38 class RenderProcessHost; |
| 39 } |
| 40 |
38 // This class is the browser component of an extension component's RenderView. | 41 // This class is the browser component of an extension component's RenderView. |
39 // It handles setting up the renderer process, if needed, with special | 42 // It handles setting up the renderer process, if needed, with special |
40 // privileges available to extensions. It may have a view to be shown in the | 43 // privileges available to extensions. It may have a view to be shown in the |
41 // browser UI, or it may be hidden. | 44 // browser UI, or it may be hidden. |
42 class ExtensionHost : public TabContentsDelegate, | 45 class ExtensionHost : public TabContentsDelegate, |
43 public TabContentsObserver, | 46 public TabContentsObserver, |
44 public ExtensionFunctionDispatcher::Delegate, | 47 public ExtensionFunctionDispatcher::Delegate, |
45 public content::NotificationObserver { | 48 public content::NotificationObserver { |
46 public: | 49 public: |
47 class ProcessCreationQueue; | 50 class ProcessCreationQueue; |
(...skipping 17 matching lines...) Expand all Loading... |
65 // Create an ExtensionView and tie it to this host and |browser|. Note NULL | 68 // Create an ExtensionView and tie it to this host and |browser|. Note NULL |
66 // is a valid argument for |browser|. Extension views may be bound to | 69 // is a valid argument for |browser|. Extension views may be bound to |
67 // tab-contents hosted in ExternalTabContainer objects, which do not | 70 // tab-contents hosted in ExternalTabContainer objects, which do not |
68 // instantiate Browser objects. | 71 // instantiate Browser objects. |
69 void CreateView(Browser* browser); | 72 void CreateView(Browser* browser); |
70 | 73 |
71 const Extension* extension() const { return extension_; } | 74 const Extension* extension() const { return extension_; } |
72 const std::string& extension_id() const { return extension_id_; } | 75 const std::string& extension_id() const { return extension_id_; } |
73 TabContents* host_contents() const { return host_contents_.get(); } | 76 TabContents* host_contents() const { return host_contents_.get(); } |
74 RenderViewHost* render_view_host() const; | 77 RenderViewHost* render_view_host() const; |
75 RenderProcessHost* render_process_host() const; | 78 content::RenderProcessHost* render_process_host() const; |
76 bool did_stop_loading() const { return did_stop_loading_; } | 79 bool did_stop_loading() const { return did_stop_loading_; } |
77 bool document_element_available() const { | 80 bool document_element_available() const { |
78 return document_element_available_; | 81 return document_element_available_; |
79 } | 82 } |
80 | 83 |
81 Profile* profile() const { return profile_; } | 84 Profile* profile() const { return profile_; } |
82 | 85 |
83 content::ViewType extension_host_type() const { return extension_host_type_; } | 86 content::ViewType extension_host_type() const { return extension_host_type_; } |
84 const GURL& GetURL() const; | 87 const GURL& GetURL() const; |
85 | 88 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // The relevant TabContents associated with this ExtensionHost, if any. | 209 // The relevant TabContents associated with this ExtensionHost, if any. |
207 TabContents* associated_tab_contents_; | 210 TabContents* associated_tab_contents_; |
208 | 211 |
209 // Used to measure how long it's been since the host was created. | 212 // Used to measure how long it's been since the host was created. |
210 PerfTimer since_created_; | 213 PerfTimer since_created_; |
211 | 214 |
212 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 215 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
213 }; | 216 }; |
214 | 217 |
215 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 218 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |