| 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 KeepBrowserProcessAlive(); |
| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // this through the host_contents because we want to deal with the pending | 247 // this through the host_contents because we want to deal with the pending |
| 242 // host, so we can send messages to it before it finishes loading. | 248 // host, so we can send messages to it before it finishes loading. |
| 243 content::RenderViewHost* render_view_host_; | 249 content::RenderViewHost* render_view_host_; |
| 244 | 250 |
| 245 // Whether the RenderWidget has reported that it has stopped loading. | 251 // Whether the RenderWidget has reported that it has stopped loading. |
| 246 bool did_stop_loading_; | 252 bool did_stop_loading_; |
| 247 | 253 |
| 248 // True if the main frame has finished parsing. | 254 // True if the main frame has finished parsing. |
| 249 bool document_element_available_; | 255 bool document_element_available_; |
| 250 | 256 |
| 257 // If true, the browser process has had a keep alive added for this host. |
| 258 bool keeping_browser_process_alive_; |
| 259 |
| 251 // The original URL of the page being hosted. | 260 // The original URL of the page being hosted. |
| 252 GURL initial_url_; | 261 GURL initial_url_; |
| 253 | 262 |
| 254 content::NotificationRegistrar registrar_; | 263 content::NotificationRegistrar registrar_; |
| 255 | 264 |
| 256 ExtensionFunctionDispatcher extension_function_dispatcher_; | 265 ExtensionFunctionDispatcher extension_function_dispatcher_; |
| 257 | 266 |
| 258 // The type of view being hosted. | 267 // The type of view being hosted. |
| 259 chrome::ViewType extension_host_type_; | 268 chrome::ViewType extension_host_type_; |
| 260 | 269 |
| 261 // The relevant WebContents associated with this ExtensionHost, if any. | 270 // The relevant WebContents associated with this ExtensionHost, if any. |
| 262 content::WebContents* associated_web_contents_; | 271 content::WebContents* associated_web_contents_; |
| 263 | 272 |
| 264 // Used to measure how long it's been since the host was created. | 273 // Used to measure how long it's been since the host was created. |
| 265 PerfTimer since_created_; | 274 PerfTimer since_created_; |
| 266 | 275 |
| 267 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 276 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 268 }; | 277 }; |
| 269 | 278 |
| 270 } // namespace extensions | 279 } // namespace extensions |
| 271 | 280 |
| 272 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 281 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |