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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // ExtensionFunctionDispatcher::Delegate | 120 // ExtensionFunctionDispatcher::Delegate |
121 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; | 121 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; |
122 virtual content::WebContents* GetVisibleWebContents() const OVERRIDE; | 122 virtual content::WebContents* GetVisibleWebContents() const OVERRIDE; |
123 void SetAssociatedWebContents(content::WebContents* web_contents); | 123 void SetAssociatedWebContents(content::WebContents* web_contents); |
124 | 124 |
125 // Returns true if the render view is initialized and didn't crash. | 125 // Returns true if the render view is initialized and didn't crash. |
126 bool IsRenderViewLive() const; | 126 bool IsRenderViewLive() const; |
127 | 127 |
128 // Prepares to initializes our RenderViewHost by creating its RenderView and | 128 // Prepares to initializes our RenderViewHost by creating its RenderView and |
129 // navigating to this host's url. Uses host_view for the RenderViewHost's view | 129 // navigating to this host's url. Uses host_view for the RenderViewHost's view |
130 // (can be NULL). This happens delayed to avoid locking the UI. | 130 // (can be NULL). This happens in a rate limited fashion to avoid locking the |
| 131 // UI. |
131 void CreateRenderViewSoon(); | 132 void CreateRenderViewSoon(); |
132 | 133 |
| 134 // Does the same thing as CreateRenderViewSoon, but only adds the creation to |
| 135 // a queue. Creation of these deferred views then happens when |
| 136 // CreateDeferredRenderViews is called. |
| 137 void CreateRenderViewDeferred(); |
| 138 |
| 139 // Creates any render views that have been deferred because |
| 140 // CreateRenderViewDeferred was called. This happens in a rate limited |
| 141 // fashion to avoid locking the UI. |
| 142 static void CreateDeferredRenderViews(); |
| 143 |
133 // Insert a default style sheet for Extension Infobars. | 144 // Insert a default style sheet for Extension Infobars. |
134 void InsertInfobarCSS(); | 145 void InsertInfobarCSS(); |
135 | 146 |
136 // Notifications from the JavaScriptDialogManager when a dialog is being | 147 // Notifications from the JavaScriptDialogManager when a dialog is being |
137 // opened/closed. | 148 // opened/closed. |
138 void WillRunJavaScriptDialog(); | 149 void WillRunJavaScriptDialog(); |
139 void DidCloseJavaScriptDialog(); | 150 void DidCloseJavaScriptDialog(); |
140 | 151 |
141 // content::WebContentsObserver | 152 // content::WebContentsObserver |
142 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 153 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 290 |
280 // Used to measure how long it's been since the host was created. | 291 // Used to measure how long it's been since the host was created. |
281 PerfTimer since_created_; | 292 PerfTimer since_created_; |
282 | 293 |
283 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 294 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
284 }; | 295 }; |
285 | 296 |
286 } // namespace extensions | 297 } // namespace extensions |
287 | 298 |
288 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 299 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |