Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: chrome/renderer/extensions/extension_helper.h

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: apitest.js Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 27 matching lines...) Expand all
104 // Callback triggered when we finish downloading the application definition 108 // Callback triggered when we finish downloading the application definition
105 // file. 109 // file.
106 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response, 110 void DidDownloadApplicationDefinition(const WebKit::WebURLResponse& response,
107 const std::string& data); 111 const std::string& data);
108 112
109 // Callback triggered after each icon referenced by the application definition 113 // Callback triggered after each icon referenced by the application definition
110 // is downloaded. 114 // is downloaded.
111 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher, 115 void DidDownloadApplicationIcon(webkit_glue::ImageResourceFetcher* fetcher,
112 const SkBitmap& image); 116 const SkBitmap& image);
113 117
114 // Helper to add an logging message to the root frame's console. 118 // Helper to add a logging message to the root frame's console.
115 void AddMessageToRootConsole(content::ConsoleMessageLevel level, 119 void AddMessageToRootConsole(content::ConsoleMessageLevel level,
116 const string16& message); 120 const string16& message);
117 121
118 Dispatcher* dispatcher_; 122 Dispatcher* dispatcher_;
119 123
120 // The app info that we are processing. This is used when installing an app 124 // The app info that we are processing. This is used when installing an app
121 // via application definition. The in-progress web app is stored here while 125 // via application definition. The in-progress web app is stored here while
122 // its manifest and icons are downloaded. 126 // its manifest and icons are downloaded.
123 scoped_ptr<WebApplicationInfo> pending_app_info_; 127 scoped_ptr<WebApplicationInfo> pending_app_info_;
124 128
(...skipping 17 matching lines...) Expand all
142 146
143 // Id number of browser window which RenderView is attached to. 147 // Id number of browser window which RenderView is attached to.
144 int browser_window_id_; 148 int browser_window_id_;
145 149
146 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper); 150 DISALLOW_COPY_AND_ASSIGN(ExtensionHelper);
147 }; 151 };
148 152
149 } // namespace extensions 153 } // namespace extensions
150 154
151 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_ 155 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698