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_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void CreateRenderViewSoon(); | 122 void CreateRenderViewSoon(); |
123 | 123 |
124 // Insert a default style sheet for Extension Infobars. | 124 // Insert a default style sheet for Extension Infobars. |
125 void InsertInfobarCSS(); | 125 void InsertInfobarCSS(); |
126 | 126 |
127 // Notifications from the JavaScriptDialogCreator when a dialog is being | 127 // Notifications from the JavaScriptDialogCreator when a dialog is being |
128 // opened/closed. | 128 // opened/closed. |
129 void WillRunJavaScriptDialog(); | 129 void WillRunJavaScriptDialog(); |
130 void DidCloseJavaScriptDialog(); | 130 void DidCloseJavaScriptDialog(); |
131 | 131 |
132 // This is called on hosts which need to keep the browser process alive. This | |
133 // function will add a browser process keep alive, if it hasn't already been | |
134 // added. Hosts which have had this called will remove the keep alive when | |
135 // they are destroyed. | |
136 void SetKeepsBrowserProcessAlive(); | |
137 | |
138 // content::WebContentsObserver | 132 // content::WebContentsObserver |
139 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
140 virtual void RenderViewCreated( | 134 virtual void RenderViewCreated( |
141 content::RenderViewHost* render_view_host) OVERRIDE; | 135 content::RenderViewHost* render_view_host) OVERRIDE; |
142 virtual void RenderViewDeleted( | 136 virtual void RenderViewDeleted( |
143 content::RenderViewHost* render_view_host) OVERRIDE; | 137 content::RenderViewHost* render_view_host) OVERRIDE; |
144 virtual void RenderViewReady() OVERRIDE; | 138 virtual void RenderViewReady() OVERRIDE; |
145 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 139 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
146 virtual void DocumentAvailableInMainFrame() OVERRIDE; | 140 virtual void DocumentAvailableInMainFrame() OVERRIDE; |
147 virtual void DidStopLoading( | 141 virtual void DidStopLoading( |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // this through the host_contents because we want to deal with the pending | 241 // this through the host_contents because we want to deal with the pending |
248 // host, so we can send messages to it before it finishes loading. | 242 // host, so we can send messages to it before it finishes loading. |
249 content::RenderViewHost* render_view_host_; | 243 content::RenderViewHost* render_view_host_; |
250 | 244 |
251 // Whether the RenderWidget has reported that it has stopped loading. | 245 // Whether the RenderWidget has reported that it has stopped loading. |
252 bool did_stop_loading_; | 246 bool did_stop_loading_; |
253 | 247 |
254 // True if the main frame has finished parsing. | 248 // True if the main frame has finished parsing. |
255 bool document_element_available_; | 249 bool document_element_available_; |
256 | 250 |
257 // If true, the browser process has had a keep alive added for this host. | |
258 bool keeping_browser_process_alive_; | |
259 | |
260 // The original URL of the page being hosted. | 251 // The original URL of the page being hosted. |
261 GURL initial_url_; | 252 GURL initial_url_; |
262 | 253 |
263 content::NotificationRegistrar registrar_; | 254 content::NotificationRegistrar registrar_; |
264 | 255 |
265 ExtensionFunctionDispatcher extension_function_dispatcher_; | 256 ExtensionFunctionDispatcher extension_function_dispatcher_; |
266 | 257 |
267 // The type of view being hosted. | 258 // The type of view being hosted. |
268 chrome::ViewType extension_host_type_; | 259 chrome::ViewType extension_host_type_; |
269 | 260 |
270 // The relevant WebContents associated with this ExtensionHost, if any. | 261 // The relevant WebContents associated with this ExtensionHost, if any. |
271 content::WebContents* associated_web_contents_; | 262 content::WebContents* associated_web_contents_; |
272 | 263 |
273 // Used to measure how long it's been since the host was created. | 264 // Used to measure how long it's been since the host was created. |
274 PerfTimer since_created_; | 265 PerfTimer since_created_; |
275 | 266 |
276 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 267 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
277 }; | 268 }; |
278 | 269 |
279 } // namespace extensions | 270 } // namespace extensions |
280 | 271 |
281 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 272 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |