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