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_VIEW_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
7 | 7 |
8 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 8 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
9 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 9 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
10 #include "skia/include/SkBitmap.h" | 10 #include "skia/include/SkBitmap.h" |
11 | 11 |
12 // TODO(port): Port these files. | 12 // TODO(port): Port these files. |
13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
14 #include "chrome/browser/views/hwnd_html_view.h" | 14 #include "chrome/browser/views/hwnd_html_view.h" |
15 #else | 15 #else |
16 #include "chrome/common/temp_scaffolding_stubs.h" | 16 #include "chrome/common/temp_scaffolding_stubs.h" |
17 #endif | 17 #endif |
18 | 18 |
19 class Browser; | 19 class Browser; |
20 class Extension; | 20 class Extension; |
| 21 class ExtensionFunctionDispatcher; |
21 class RenderWidgetHost; | 22 class RenderWidgetHost; |
22 class RenderWidgetHostView; | 23 class RenderWidgetHostView; |
23 class WebContents; | 24 class WebContents; |
24 struct WebPreferences; | 25 struct WebPreferences; |
25 | 26 |
26 // This class is the browser component of an extension component's RenderView. | 27 // This class is the browser component of an extension component's RenderView. |
27 // It handles setting up the renderer process, if needed, with special | 28 // It handles setting up the renderer process, if needed, with special |
28 // priviliges available to extensions. The view may be drawn to the screen or | 29 // priviliges available to extensions. The view may be drawn to the screen or |
29 // hidden. | 30 // hidden. |
30 class ExtensionView : public HWNDHtmlView, | 31 class ExtensionView : public HWNDHtmlView, |
31 public RenderViewHostDelegate, | 32 public RenderViewHostDelegate, |
32 public RenderViewHostDelegate::View { | 33 public RenderViewHostDelegate::View { |
33 public: | 34 public: |
34 // ExtensionView | 35 // ExtensionView |
35 ExtensionView(Extension* extension, | 36 ExtensionView(Extension* extension, |
36 const GURL& url, | 37 const GURL& url, |
37 SiteInstance* instance, | 38 SiteInstance* instance, |
38 Browser* browser); | 39 Browser* browser); |
39 | 40 |
40 Extension* extension() { return extension_; } | 41 Extension* extension() { return extension_; } |
41 | 42 |
42 // HWNDHtmlView | 43 // HWNDHtmlView |
43 virtual void CreatingRenderer(); | 44 virtual void CreatingRenderer(); |
44 | 45 |
45 virtual void SetBackground(const SkBitmap& background); | 46 virtual void SetBackground(const SkBitmap& background); |
46 | 47 |
47 // RenderViewHostDelegate | 48 // RenderViewHostDelegate |
48 // TODO(mpcomplete): GetProfile is unused. | 49 // TODO(mpcomplete): GetProfile is unused. |
49 virtual Profile* GetProfile() const { return NULL; } | 50 virtual Profile* GetProfile() const { return NULL; } |
| 51 virtual ExtensionFunctionDispatcher *CreateExtensionFunctionDispatcher( |
| 52 RenderViewHost *render_view_host, |
| 53 const std::string& extension_id); |
50 virtual void RenderViewCreated(RenderViewHost* render_view_host); | 54 virtual void RenderViewCreated(RenderViewHost* render_view_host); |
51 virtual void DidContentsPreferredWidthChange(const int pref_width); | 55 virtual void DidContentsPreferredWidthChange(const int pref_width); |
52 virtual void DidStopLoading(RenderViewHost* render_view_host, | 56 virtual void DidStopLoading(RenderViewHost* render_view_host, |
53 int32 page_id); | 57 int32 page_id); |
54 virtual WebPreferences GetWebkitPrefs(); | 58 virtual WebPreferences GetWebkitPrefs(); |
55 virtual void RunJavaScriptMessage( | 59 virtual void RunJavaScriptMessage( |
56 const std::wstring& message, | 60 const std::wstring& message, |
57 const std::wstring& default_prompt, | 61 const std::wstring& default_prompt, |
58 const GURL& frame_url, | 62 const GURL& frame_url, |
59 const int flags, | 63 const int flags, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool did_stop_loading_; | 100 bool did_stop_loading_; |
97 | 101 |
98 // What we should set the preferred width to once the ExtensionView has | 102 // What we should set the preferred width to once the ExtensionView has |
99 // loaded. | 103 // loaded. |
100 int pending_preferred_width_; | 104 int pending_preferred_width_; |
101 | 105 |
102 DISALLOW_COPY_AND_ASSIGN(ExtensionView); | 106 DISALLOW_COPY_AND_ASSIGN(ExtensionView); |
103 }; | 107 }; |
104 | 108 |
105 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ | 109 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_H_ |
OLD | NEW |