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 class ListValue; | |
19 struct ExtensionMsg_ExecuteCode_Params; | 18 struct ExtensionMsg_ExecuteCode_Params; |
20 struct WebApplicationInfo; | 19 struct WebApplicationInfo; |
21 | 20 |
| 21 namespace base { |
| 22 class ListValue; |
| 23 } |
| 24 |
22 namespace webkit_glue { | 25 namespace webkit_glue { |
23 class ResourceFetcher; | 26 class ResourceFetcher; |
24 } | 27 } |
25 | 28 |
26 // Filters extension related messages sent to RenderViews. | 29 // Filters extension related messages sent to RenderViews. |
27 class ExtensionHelper : public RenderViewObserver, | 30 class ExtensionHelper : public RenderViewObserver, |
28 public RenderViewObserverTracker<ExtensionHelper> { | 31 public RenderViewObserverTracker<ExtensionHelper> { |
29 public: | 32 public: |
30 ExtensionHelper(RenderView* render_view, | 33 ExtensionHelper(RenderView* render_view, |
31 ExtensionDispatcher* extension_dispatcher); | 34 ExtensionDispatcher* extension_dispatcher); |
(...skipping 18 matching lines...) Expand all Loading... |
50 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame); | 53 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame); |
51 virtual void FrameDetached(WebKit::WebFrame* frame); | 54 virtual void FrameDetached(WebKit::WebFrame* frame); |
52 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 55 virtual void DidCreateDataSource(WebKit::WebFrame* frame, |
53 WebKit::WebDataSource* ds); | 56 WebKit::WebDataSource* ds); |
54 | 57 |
55 void OnExtensionResponse(int request_id, bool success, | 58 void OnExtensionResponse(int request_id, bool success, |
56 const std::string& response, | 59 const std::string& response, |
57 const std::string& error); | 60 const std::string& error); |
58 void OnExtensionMessageInvoke(const std::string& extension_id, | 61 void OnExtensionMessageInvoke(const std::string& extension_id, |
59 const std::string& function_name, | 62 const std::string& function_name, |
60 const ListValue& args, | 63 const base::ListValue& args, |
61 const GURL& event_url); | 64 const GURL& event_url); |
62 void OnExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); | 65 void OnExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); |
63 void OnGetApplicationInfo(int page_id); | 66 void OnGetApplicationInfo(int page_id); |
64 void OnNotifyRendererViewType(ViewType::Type view_type); | 67 void OnNotifyRendererViewType(ViewType::Type view_type); |
65 void OnUpdateBrowserWindowId(int window_id); | 68 void OnUpdateBrowserWindowId(int window_id); |
66 | 69 |
67 // Callback triggered when we finish downloading the application definition | 70 // Callback triggered when we finish downloading the application definition |
68 // file. | 71 // file. |
69 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, | 72 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, |
70 const std::string& data); | 73 const std::string& data); |
(...skipping 26 matching lines...) Expand all Loading... |
97 // Type of view attached with RenderView. | 100 // Type of view attached with RenderView. |
98 ViewType::Type view_type_; | 101 ViewType::Type view_type_; |
99 | 102 |
100 // Id number of browser window which RenderView is attached to. | 103 // Id number of browser window which RenderView is attached to. |
101 int browser_window_id_; | 104 int browser_window_id_; |
102 | 105 |
103 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); | 106 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); |
104 }; | 107 }; |
105 | 108 |
106 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 109 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
OLD | NEW |