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 | |
Andrew T Wilson (Slow)
2012/11/28 10:16:24
nit: btw, I've always preferred "keep-alive" to "k
benwells
2012/11/29 06:50:58
Done.
| |
135 // they are destroyed. | |
136 void SetKeepsBrowserProcessAlive(); | |
137 | |
132 // content::WebContentsObserver | 138 // content::WebContentsObserver |
133 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 139 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
134 virtual void RenderViewCreated( | 140 virtual void RenderViewCreated( |
135 content::RenderViewHost* render_view_host) OVERRIDE; | 141 content::RenderViewHost* render_view_host) OVERRIDE; |
136 virtual void RenderViewDeleted( | 142 virtual void RenderViewDeleted( |
137 content::RenderViewHost* render_view_host) OVERRIDE; | 143 content::RenderViewHost* render_view_host) OVERRIDE; |
138 virtual void RenderViewReady() OVERRIDE; | 144 virtual void RenderViewReady() OVERRIDE; |
139 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 145 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
140 virtual void DocumentAvailableInMainFrame() OVERRIDE; | 146 virtual void DocumentAvailableInMainFrame() OVERRIDE; |
141 virtual void DidStopLoading( | 147 virtual void DidStopLoading( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 // this through the host_contents because we want to deal with the pending | 244 // this through the host_contents because we want to deal with the pending |
239 // host, so we can send messages to it before it finishes loading. | 245 // host, so we can send messages to it before it finishes loading. |
240 content::RenderViewHost* render_view_host_; | 246 content::RenderViewHost* render_view_host_; |
241 | 247 |
242 // Whether the RenderWidget has reported that it has stopped loading. | 248 // Whether the RenderWidget has reported that it has stopped loading. |
243 bool did_stop_loading_; | 249 bool did_stop_loading_; |
244 | 250 |
245 // True if the main frame has finished parsing. | 251 // True if the main frame has finished parsing. |
246 bool document_element_available_; | 252 bool document_element_available_; |
247 | 253 |
254 // If true, the browser process has had a keep alive added for this host. | |
255 bool keeping_browser_process_alive_; | |
256 | |
248 // The original URL of the page being hosted. | 257 // The original URL of the page being hosted. |
249 GURL initial_url_; | 258 GURL initial_url_; |
250 | 259 |
251 content::NotificationRegistrar registrar_; | 260 content::NotificationRegistrar registrar_; |
252 | 261 |
253 ExtensionFunctionDispatcher extension_function_dispatcher_; | 262 ExtensionFunctionDispatcher extension_function_dispatcher_; |
254 | 263 |
255 // The type of view being hosted. | 264 // The type of view being hosted. |
256 chrome::ViewType extension_host_type_; | 265 chrome::ViewType extension_host_type_; |
257 | 266 |
258 // The relevant WebContents associated with this ExtensionHost, if any. | 267 // The relevant WebContents associated with this ExtensionHost, if any. |
259 content::WebContents* associated_web_contents_; | 268 content::WebContents* associated_web_contents_; |
260 | 269 |
261 // Used to measure how long it's been since the host was created. | 270 // Used to measure how long it's been since the host was created. |
262 PerfTimer since_created_; | 271 PerfTimer since_created_; |
263 | 272 |
264 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 273 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
265 }; | 274 }; |
266 | 275 |
267 } // namespace extensions | 276 } // namespace extensions |
268 | 277 |
269 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 278 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |