OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 13 matching lines...) Expand all Loading... |
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 PrefsTabHelper; | 32 class PrefsTabHelper; |
33 class RenderWidgetHostView; | 33 class RenderWidgetHostView; |
34 class SiteInstance; | |
35 struct WebPreferences; | 34 struct WebPreferences; |
36 | 35 |
37 namespace content { | 36 namespace content { |
38 class RenderProcessHost; | 37 class RenderProcessHost; |
| 38 class SiteInstance; |
39 } | 39 } |
40 | 40 |
41 // 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. |
42 // It handles setting up the renderer process, if needed, with special | 42 // It handles setting up the renderer process, if needed, with special |
43 // 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 |
44 // browser UI, or it may be hidden. | 44 // browser UI, or it may be hidden. |
45 class ExtensionHost : public content::WebContentsDelegate, | 45 class ExtensionHost : public content::WebContentsDelegate, |
46 public content::WebContentsObserver, | 46 public content::WebContentsObserver, |
47 public ExtensionFunctionDispatcher::Delegate, | 47 public ExtensionFunctionDispatcher::Delegate, |
48 public content::NotificationObserver { | 48 public content::NotificationObserver { |
49 public: | 49 public: |
50 class ProcessCreationQueue; | 50 class ProcessCreationQueue; |
51 | 51 |
52 ExtensionHost(const Extension* extension, SiteInstance* site_instance, | 52 ExtensionHost(const Extension* extension, |
| 53 content::SiteInstance* site_instance, |
53 const GURL& url, content::ViewType host_type); | 54 const GURL& url, content::ViewType host_type); |
54 virtual ~ExtensionHost(); | 55 virtual ~ExtensionHost(); |
55 | 56 |
56 #if defined(TOOLKIT_VIEWS) | 57 #if defined(TOOLKIT_VIEWS) |
57 void set_view(ExtensionView* view) { view_.reset(view); } | 58 void set_view(ExtensionView* view) { view_.reset(view); } |
58 const ExtensionView* view() const { return view_.get(); } | 59 const ExtensionView* view() const { return view_.get(); } |
59 ExtensionView* view() { return view_.get(); } | 60 ExtensionView* view() { return view_.get(); } |
60 #elif defined(OS_MACOSX) | 61 #elif defined(OS_MACOSX) |
61 const ExtensionViewMac* view() const { return view_.get(); } | 62 const ExtensionViewMac* view() const { return view_.get(); } |
62 ExtensionViewMac* view() { return view_.get(); } | 63 ExtensionViewMac* view() { return view_.get(); } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // The relevant WebContents associated with this ExtensionHost, if any. | 229 // The relevant WebContents associated with this ExtensionHost, if any. |
229 content::WebContents* associated_web_contents_; | 230 content::WebContents* associated_web_contents_; |
230 | 231 |
231 // Used to measure how long it's been since the host was created. | 232 // Used to measure how long it's been since the host was created. |
232 PerfTimer since_created_; | 233 PerfTimer since_created_; |
233 | 234 |
234 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 235 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
235 }; | 236 }; |
236 | 237 |
237 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 238 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |