| 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 | |
| 71 private: | 67 private: |
| 72 // RenderViewObserver implementation. | 68 // RenderViewObserver implementation. |
| 73 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 69 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 74 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; | 70 virtual void DidFinishDocumentLoad(WebKit::WebFrame* frame) OVERRIDE; |
| 75 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; | 71 virtual void DidFinishLoad(WebKit::WebFrame* frame) OVERRIDE; |
| 76 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame) OVERRIDE; | 72 virtual void DidCreateDocumentElement(WebKit::WebFrame* frame) OVERRIDE; |
| 77 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) OVERRIDE; | 73 virtual void DidStartProvisionalLoad(WebKit::WebFrame* frame) OVERRIDE; |
| 78 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; | 74 virtual void FrameDetached(WebKit::WebFrame* frame) OVERRIDE; |
| 79 virtual void DidCreateDataSource(WebKit::WebFrame* frame, | 75 virtual void DidCreateDataSource(WebKit::WebFrame* frame, |
| 80 WebKit::WebDataSource* ds) OVERRIDE; | 76 WebKit::WebDataSource* ds) OVERRIDE; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 108 // Callback triggered when we finish downloading the application definition | 104 // Callback triggered when we finish downloading the application definition |
| 109 // file. | 105 // file. |
| 110 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, | 106 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, |
| 111 const std::string& data); | 107 const std::string& data); |
| 112 | 108 |
| 113 // Callback triggered after each icon referenced by the application definition | 109 // Callback triggered after each icon referenced by the application definition |
| 114 // is downloaded. | 110 // is downloaded. |
| 115 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, | 111 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, |
| 116 const SkBitmap& image); | 112 const SkBitmap& image); |
| 117 | 113 |
| 118 // Helper to add a logging message to the root frame's console. | 114 // Helper to add an logging message to the root frame's console. |
| 119 void AddMessageToRootConsole(content::ConsoleMessageLevel level, | 115 void AddMessageToRootConsole(content::ConsoleMessageLevel level, |
| 120 const string16& message); | 116 const string16& message); |
| 121 | 117 |
| 122 Dispatcher* dispatcher_; | 118 Dispatcher* dispatcher_; |
| 123 | 119 |
| 124 // The app info that we are processing. This is used when installing an app | 120 // The app info that we are processing. This is used when installing an app |
| 125 // via application definition. The in-progress web app is stored here while | 121 // via application definition. The in-progress web app is stored here while |
| 126 // its manifest and icons are downloaded. | 122 // its manifest and icons are downloaded. |
| 127 scoped_ptr<WebApplicationInfo> pending_app_info_; | 123 scoped_ptr<WebApplicationInfo> pending_app_info_; |
| 128 | 124 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 146 | 142 |
| 147 // Id number of browser window which RenderView is attached to. | 143 // Id number of browser window which RenderView is attached to. |
| 148 int browser_window_id_; | 144 int browser_window_id_; |
| 149 | 145 |
| 150 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); | 146 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); |
| 151 }; | 147 }; |
| 152 | 148 |
| 153 } // namespace extensions | 149 } // namespace extensions |
| 154 | 150 |
| 155 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ | 151 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ |
| OLD | NEW |