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_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "content/common/view_types.h" | 11 #include "content/common/view_types.h" |
12 #include "content/renderer/render_view.h" | 12 #include "content/renderer/render_view.h" |
13 #include "content/renderer/render_view_observer.h" | 13 #include "content/renderer/render_view_observer.h" |
14 #include "content/renderer/render_view_observer_tracker.h" | 14 #include "content/renderer/render_view_observer_tracker.h" |
15 | 15 |
16 class ExtensionDispatcher; | 16 class ExtensionDispatcher; |
17 class GURL; | 17 class GURL; |
18 struct ExtensionMsg_ExecuteCode_Params; | 18 struct ExtensionMsg_ExecuteCode_Params; |
19 struct WebApplicationInfo; | 19 struct WebApplicationInfo; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class ListValue; | 22 class ListValue; |
23 } | 23 } |
24 | 24 |
25 namespace webkit_glue { | 25 namespace webkit_glue { |
26 class ResourceFetcher; | 26 class ResourceFetcher; |
27 } | 27 } |
28 | 28 |
29 // Filters extension related messages sent to RenderViews. | 29 // RenderView-level plumbing for extension features. |
30 class ExtensionHelper : public RenderViewObserver, | 30 class ExtensionHelper : public RenderViewObserver, |
31 public RenderViewObserverTracker<ExtensionHelper> { | 31 public RenderViewObserverTracker<ExtensionHelper> { |
32 public: | 32 public: |
33 ExtensionHelper(RenderView* render_view, | 33 ExtensionHelper(RenderView* render_view, |
34 ExtensionDispatcher* extension_dispatcher); | 34 ExtensionDispatcher* extension_dispatcher); |
35 virtual ~ExtensionHelper(); | 35 virtual ~ExtensionHelper(); |
36 | 36 |
37 // Starts installation of the page in the specified frame as a web app. The | 37 // Starts installation of the page in the specified frame as a web app. The |
38 // page must link to an external 'definition file'. This is different from | 38 // page must link to an external 'definition file'. This is different from |
39 // the 'application shortcuts' feature where we pull the application | 39 // the 'application shortcuts' feature where we pull the application |
40 // definition out of optional meta tags in the page. | 40 // definition out of optional meta tags in the page. |
41 bool InstallWebApplicationUsingDefinitionFile(WebKit::WebFrame* frame, | 41 bool InstallWebApplicationUsingDefinitionFile(WebKit::WebFrame* frame, |
42 string16* error); | 42 string16* error); |
43 | 43 |
| 44 void InlineWebstoreInstall(std::string webstore_item_id); |
| 45 |
44 int browser_window_id() const { return browser_window_id_; } | 46 int browser_window_id() const { return browser_window_id_; } |
45 ViewType::Type view_type() const { return view_type_; } | 47 ViewType::Type view_type() const { return view_type_; } |
46 | 48 |
47 private: | 49 private: |
48 // RenderViewObserver implementation. | 50 // RenderViewObserver implementation. |
49 virtual bool OnMessageReceived(const IPC::Message& message); | 51 virtual bool OnMessageReceived(const IPC::Message& message); |
50 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame); | 52 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame); |
51 virtual void DidFinishLoad(WebKit::WebFrame* frame); | 53 virtual void DidFinishLoad(WebKit::WebFrame* frame); |
52 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame); | 54 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame); |
53 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame); | 55 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Type of view attached with RenderView. | 102 // Type of view attached with RenderView. |
101 ViewType::Type view_type_; | 103 ViewType::Type view_type_; |
102 | 104 |
103 // Id number of browser window which RenderView is attached to. | 105 // Id number of browser window which RenderView is attached to. |
104 int browser_window_id_; | 106 int browser_window_id_; |
105 | 107 |
106 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); | 108 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); |
107 }; | 109 }; |
108 | 110 |
109 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 111 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
OLD | NEW |