OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // page must link to an external 'definition file'. This is different from | 57 // page must link to an external 'definition file'. This is different from |
58 // the 'application shortcuts' feature where we pull the application | 58 // the 'application shortcuts' feature where we pull the application |
59 // definition out of optional meta tags in the page. | 59 // definition out of optional meta tags in the page. |
60 bool InstallWebApplicationUsingDefinitionFile(WebKit::WebFrame* frame, | 60 bool InstallWebApplicationUsingDefinitionFile(WebKit::WebFrame* frame, |
61 string16* error); | 61 string16* error); |
62 | 62 |
63 int tab_id() const { return tab_id_; } | 63 int tab_id() const { return tab_id_; } |
64 int browser_window_id() const { return browser_window_id_; } | 64 int browser_window_id() const { return browser_window_id_; } |
65 chrome::ViewType view_type() const { return view_type_; } | 65 chrome::ViewType view_type() const { return view_type_; } |
66 | 66 |
| 67 // Helper to add a logging message to the root frame's console. |
| 68 void AddMessageToRootConsole(content::ConsoleMessageLevel level, |
| 69 const std::string& message); |
| 70 |
67 private: | 71 private: |
68 // RenderViewObserver implementation. | 72 // RenderViewObserver implementation. |
69 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 73 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
70 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; | 74 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; |
71 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; | 75 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; |
72 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame) OVERRIDE; | 76 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame) OVERRIDE; |
73 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) OVERRIDE; | 77 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) OVERRIDE; |
74 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; | 78 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; |
75 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 79 virtual void DidCreateDataSource(WebKit::WebFrame* frame, |
76 WebKit::WebDataSource* ds) OVERRIDE; | 80 WebKit::WebDataSource* ds) OVERRIDE; |
(...skipping 28 matching lines...) Expand all Loading... |
105 // Callback triggered when we finish downloading the application definition | 109 // Callback triggered when we finish downloading the application definition |
106 // file. | 110 // file. |
107 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, | 111 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, |
108 const std::string& data); | 112 const std::string& data); |
109 | 113 |
110 // Callback triggered after each icon referenced by the application definition | 114 // Callback triggered after each icon referenced by the application definition |
111 // is downloaded. | 115 // is downloaded. |
112 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, | 116 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, |
113 const SkBitmap& image); | 117 const SkBitmap& image); |
114 | 118 |
115 // Helper to add an logging message to the root frame's console. | 119 // Helper to add a logging message to the root frame's console. |
116 void AddMessageToRootConsole(content::ConsoleMessageLevel level, | 120 void AddMessageToRootConsole(content::ConsoleMessageLevel level, |
117 const string16& message); | 121 const string16& message); |
118 | 122 |
119 Dispatcher* dispatcher_; | 123 Dispatcher* dispatcher_; |
120 | 124 |
121 // The app info that we are processing. This is used when installing an app | 125 // The app info that we are processing. This is used when installing an app |
122 // via application definition. The in-progress web app is stored here while | 126 // via application definition. The in-progress web app is stored here while |
123 // its manifest and icons are downloaded. | 127 // its manifest and icons are downloaded. |
124 scoped_ptr<WebApplicationInfo> pending_app_info_; | 128 scoped_ptr<WebApplicationInfo> pending_app_info_; |
125 | 129 |
(...skipping 17 matching lines...) Expand all Loading... |
143 | 147 |
144 // Id number of browser window which RenderView is attached to. | 148 // Id number of browser window which RenderView is attached to. |
145 int browser_window_id_; | 149 int browser_window_id_; |
146 | 150 |
147 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); | 151 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); |
148 }; | 152 }; |
149 | 153 |
150 } // namespace extensions | 154 } // namespace extensions |
151 | 155 |
152 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 156 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
OLD | NEW |