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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 ViewType extension_host_type() const { return extension_host_type_; } | 64 ViewType extension_host_type() const { return extension_host_type_; } |
65 const GURL& GetURL() const; | 65 const GURL& GetURL() const; |
66 | 66 |
67 // Returns true if the render view is initialized and didn't crash. | 67 // Returns true if the render view is initialized and didn't crash. |
68 bool IsRenderViewLive() const; | 68 bool IsRenderViewLive() const; |
69 | 69 |
70 // Prepares to initializes our RenderViewHost by creating its RenderView and | 70 // Prepares to initializes our RenderViewHost by creating its RenderView and |
71 // navigating to this host's url. Uses host_view for the RenderViewHost's view | 71 // navigating to this host's url. Uses host_view for the RenderViewHost's view |
72 // (can be NULL). This happens delayed to avoid locking the UI. | 72 // (can be NULL). This happens delayed to avoid locking the UI. |
73 void CreateRenderViewSoon(); | 73 void CreateRenderViewSoon(const base::Closure& continuation); |
74 | 74 |
75 // content::WebContentsObserver | 75 // content::WebContentsObserver |
76 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 76 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
77 virtual void RenderViewCreated( | 77 virtual void RenderViewCreated( |
78 content::RenderViewHost* render_view_host) OVERRIDE; | 78 content::RenderViewHost* render_view_host) OVERRIDE; |
79 virtual void RenderViewDeleted( | 79 virtual void RenderViewDeleted( |
80 content::RenderViewHost* render_view_host) OVERRIDE; | 80 content::RenderViewHost* render_view_host) OVERRIDE; |
81 virtual void RenderViewReady() OVERRIDE; | 81 virtual void RenderViewReady() OVERRIDE; |
82 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; | 82 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; |
83 virtual void DocumentAvailableInMainFrame() OVERRIDE; | 83 virtual void DocumentAvailableInMainFrame() OVERRIDE; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 content::NotificationRegistrar registrar_; | 170 content::NotificationRegistrar registrar_; |
171 | 171 |
172 ExtensionFunctionDispatcher extension_function_dispatcher_; | 172 ExtensionFunctionDispatcher extension_function_dispatcher_; |
173 | 173 |
174 // The type of view being hosted. | 174 // The type of view being hosted. |
175 ViewType extension_host_type_; | 175 ViewType extension_host_type_; |
176 | 176 |
177 // Used to measure how long it's been since the host was created. | 177 // Used to measure how long it's been since the host was created. |
178 base::ElapsedTimer since_created_; | 178 base::ElapsedTimer since_created_; |
179 | 179 |
| 180 // Called when the RenderView is created. |
| 181 std::vector<base::Closure> when_render_view_created_; |
| 182 |
180 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 183 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
181 }; | 184 }; |
182 | 185 |
183 } // namespace extensions | 186 } // namespace extensions |
184 | 187 |
185 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 188 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
OLD | NEW |