| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 // Insert a default style sheet for Extension Infobars. | 102 // Insert a default style sheet for Extension Infobars. |
| 103 void InsertInfobarCSS(); | 103 void InsertInfobarCSS(); |
| 104 | 104 |
| 105 // Tell the renderer not to draw scrollbars on windows smaller than | 105 // Tell the renderer not to draw scrollbars on windows smaller than |
| 106 // |size_limit| in both width and height. | 106 // |size_limit| in both width and height. |
| 107 void DisableScrollbarsForSmallWindows(const gfx::Size& size_limit); | 107 void DisableScrollbarsForSmallWindows(const gfx::Size& size_limit); |
| 108 | 108 |
| 109 // TabContentsObserver | 109 // TabContentsObserver |
| 110 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 110 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 111 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | 111 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| 112 virtual void RenderViewDeleted(RenderViewHost* render_view_host) OVERRIDE; |
| 112 virtual void RenderViewReady() OVERRIDE; | 113 virtual void RenderViewReady() OVERRIDE; |
| 113 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 114 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 114 virtual void DocumentAvailableInMainFrame() OVERRIDE; | 115 virtual void DocumentAvailableInMainFrame() OVERRIDE; |
| 115 virtual void DidStopLoading() OVERRIDE; | 116 virtual void DidStopLoading() OVERRIDE; |
| 116 | 117 |
| 117 // TabContentsDelegate | 118 // TabContentsDelegate |
| 118 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 119 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 119 bool* is_keyboard_shortcut) OVERRIDE; | 120 bool* is_keyboard_shortcut) OVERRIDE; |
| 120 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) | 121 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) |
| 121 OVERRIDE; | 122 OVERRIDE; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 scoped_ptr<ExtensionView> view_; | 182 scoped_ptr<ExtensionView> view_; |
| 182 #elif defined(OS_MACOSX) | 183 #elif defined(OS_MACOSX) |
| 183 scoped_ptr<ExtensionViewMac> view_; | 184 scoped_ptr<ExtensionViewMac> view_; |
| 184 #elif defined(TOOLKIT_GTK) | 185 #elif defined(TOOLKIT_GTK) |
| 185 scoped_ptr<ExtensionViewGtk> view_; | 186 scoped_ptr<ExtensionViewGtk> view_; |
| 186 #endif | 187 #endif |
| 187 | 188 |
| 188 // The host for our HTML content. | 189 // The host for our HTML content. |
| 189 scoped_ptr<TabContents> host_contents_; | 190 scoped_ptr<TabContents> host_contents_; |
| 190 | 191 |
| 192 // A weak pointer to the current or pending RenderViewHost. We don't access |
| 193 // this through the host_contents because we want to deal with the pending |
| 194 // host, so we can send messages to it before it finishes loading. |
| 195 RenderViewHost* render_view_host_; |
| 196 |
| 191 // Whether the RenderWidget has reported that it has stopped loading. | 197 // Whether the RenderWidget has reported that it has stopped loading. |
| 192 bool did_stop_loading_; | 198 bool did_stop_loading_; |
| 193 | 199 |
| 194 // True if the main frame has finished parsing. | 200 // True if the main frame has finished parsing. |
| 195 bool document_element_available_; | 201 bool document_element_available_; |
| 196 | 202 |
| 197 // The original URL of the page being hosted. | 203 // The original URL of the page being hosted. |
| 198 GURL initial_url_; | 204 GURL initial_url_; |
| 199 | 205 |
| 200 content::NotificationRegistrar registrar_; | 206 content::NotificationRegistrar registrar_; |
| 201 | 207 |
| 202 ExtensionFunctionDispatcher extension_function_dispatcher_; | 208 ExtensionFunctionDispatcher extension_function_dispatcher_; |
| 203 | 209 |
| 204 // Only EXTENSION_INFOBAR, EXTENSION_POPUP, and EXTENSION_BACKGROUND_PAGE | 210 // Only EXTENSION_INFOBAR, EXTENSION_POPUP, and EXTENSION_BACKGROUND_PAGE |
| 205 // are used here, others are not hosted by ExtensionHost. | 211 // are used here, others are not hosted by ExtensionHost. |
| 206 content::ViewType extension_host_type_; | 212 content::ViewType extension_host_type_; |
| 207 | 213 |
| 208 // The relevant TabContents associated with this ExtensionHost, if any. | 214 // The relevant TabContents associated with this ExtensionHost, if any. |
| 209 TabContents* associated_tab_contents_; | 215 TabContents* associated_tab_contents_; |
| 210 | 216 |
| 211 // Used to measure how long it's been since the host was created. | 217 // Used to measure how long it's been since the host was created. |
| 212 PerfTimer since_created_; | 218 PerfTimer since_created_; |
| 213 | 219 |
| 214 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 220 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 215 }; | 221 }; |
| 216 | 222 |
| 217 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 223 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |