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