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 |
(...skipping 27 matching lines...) Expand all Loading... |
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(int install_id, | 44 void InlineWebstoreInstall(int install_id, |
45 std::string webstore_item_id, | 45 std::string webstore_item_id, |
46 GURL requestor_url); | 46 GURL requestor_url); |
47 | 47 |
| 48 // Starts fetching a channel id for server pushed notifications. The result |
| 49 // comes back via OnGetAppNotifyChannelResponse. |
| 50 void GetAppNotifyChannel(int request_id, |
| 51 const GURL& requestor_url, |
| 52 const std::string& client_id); |
| 53 |
48 int browser_window_id() const { return browser_window_id_; } | 54 int browser_window_id() const { return browser_window_id_; } |
49 ViewType::Type view_type() const { return view_type_; } | 55 ViewType::Type view_type() const { return view_type_; } |
50 | 56 |
51 private: | 57 private: |
52 // RenderViewObserver implementation. | 58 // RenderViewObserver implementation. |
53 virtual bool OnMessageReceived(const IPC::Message& message); | 59 virtual bool OnMessageReceived(const IPC::Message& message); |
54 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame); | 60 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame); |
55 virtual void DidFinishLoad(WebKit::WebFrame* frame); | 61 virtual void DidFinishLoad(WebKit::WebFrame* frame); |
56 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame); | 62 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame); |
57 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame); | 63 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame); |
58 virtual void FrameDetached(WebKit::WebFrame* frame); | 64 virtual void FrameDetached(WebKit::WebFrame* frame); |
59 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 65 virtual void DidCreateDataSource(WebKit::WebFrame* frame, |
60 WebKit::WebDataSource* ds); | 66 WebKit::WebDataSource* ds); |
61 | 67 |
62 void OnExtensionResponse(int request_id, bool success, | 68 void OnExtensionResponse(int request_id, bool success, |
63 const std::string& response, | 69 const std::string& response, |
64 const std::string& error); | 70 const std::string& error); |
65 void OnExtensionMessageInvoke(const std::string& extension_id, | 71 void OnExtensionMessageInvoke(const std::string& extension_id, |
66 const std::string& function_name, | 72 const std::string& function_name, |
67 const base::ListValue& args, | 73 const base::ListValue& args, |
68 const GURL& event_url); | 74 const GURL& event_url); |
69 void OnExtensionDeliverMessage(int target_port_id, | 75 void OnExtensionDeliverMessage(int target_port_id, |
70 const std::string& message); | 76 const std::string& message); |
71 void OnExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); | 77 void OnExecuteCode(const ExtensionMsg_ExecuteCode_Params& params); |
72 void OnGetApplicationInfo(int page_id); | 78 void OnGetApplicationInfo(int page_id); |
73 void OnNotifyRendererViewType(ViewType::Type view_type); | 79 void OnNotifyRendererViewType(ViewType::Type view_type); |
74 void OnUpdateBrowserWindowId(int window_id); | 80 void OnUpdateBrowserWindowId(int window_id); |
75 void OnInlineWebstoreInstallResponse( | 81 void OnInlineWebstoreInstallResponse( |
76 int install_id, bool success, const std::string& error); | 82 int install_id, bool success, const std::string& error); |
| 83 void OnGetAppNotifyChannelResponse( |
| 84 int request_id, const std::string& channel_id, const std::string& error); |
77 | 85 |
78 // Callback triggered when we finish downloading the application definition | 86 // Callback triggered when we finish downloading the application definition |
79 // file. | 87 // file. |
80 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, | 88 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, |
81 const std::string& data); | 89 const std::string& data); |
82 | 90 |
83 // Callback triggered after each icon referenced by the application definition | 91 // Callback triggered after each icon referenced by the application definition |
84 // is downloaded. | 92 // is downloaded. |
85 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, | 93 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, |
86 const SkBitmap& image); | 94 const SkBitmap& image); |
(...skipping 21 matching lines...) Expand all Loading... |
108 // Type of view attached with RenderView. | 116 // Type of view attached with RenderView. |
109 ViewType::Type view_type_; | 117 ViewType::Type view_type_; |
110 | 118 |
111 // Id number of browser window which RenderView is attached to. | 119 // Id number of browser window which RenderView is attached to. |
112 int browser_window_id_; | 120 int browser_window_id_; |
113 | 121 |
114 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); | 122 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); |
115 }; | 123 }; |
116 | 124 |
117 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 125 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
OLD | NEW |