| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <list> | 10 #include <list> |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 friend class ProcessCreationQueue; | 205 friend class ProcessCreationQueue; |
| 206 | 206 |
| 207 // Whether to allow DOM automation for created RenderViewHosts. This is used | 207 // Whether to allow DOM automation for created RenderViewHosts. This is used |
| 208 // for testing. | 208 // for testing. |
| 209 static bool enable_dom_automation_; | 209 static bool enable_dom_automation_; |
| 210 | 210 |
| 211 // Actually create the RenderView for this host. See CreateRenderViewSoon. | 211 // Actually create the RenderView for this host. See CreateRenderViewSoon. |
| 212 void CreateRenderViewNow(); | 212 void CreateRenderViewNow(); |
| 213 | 213 |
| 214 // ExtensionFunctionDispatcher::Delegate | 214 // ExtensionFunctionDispatcher::Delegate |
| 215 virtual Browser* GetBrowser() const { | 215 virtual Browser* GetBrowser() const; |
| 216 return view() ? view()->browser() : NULL; | 216 virtual gfx::NativeView GetNativeViewOfHost(); |
| 217 } | |
| 218 virtual gfx::NativeView GetNativeViewOfHost() { | |
| 219 return view() ? view()->native_view() : NULL; | |
| 220 } | |
| 221 | 217 |
| 222 // Handles keyboard events that were not handled by HandleKeyboardEvent(). | 218 // Handles keyboard events that were not handled by HandleKeyboardEvent(). |
| 223 // Platform specific implementation may override this method to handle the | 219 // Platform specific implementation may override this method to handle the |
| 224 // event in platform specific way. | 220 // event in platform specific way. |
| 225 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 221 virtual void UnhandledKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
| 226 | 222 |
| 227 // Returns true if we're hosting a background page. | 223 // Returns true if we're hosting a background page. |
| 228 // This isn't valid until CreateRenderView is called. | 224 // This isn't valid until CreateRenderView is called. |
| 229 bool is_background_page() const { return !view(); } | 225 bool is_background_page() const { return !view(); } |
| 230 | 226 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 // Used to measure how long it's been since the host was created. | 268 // Used to measure how long it's been since the host was created. |
| 273 PerfTimer since_created_; | 269 PerfTimer since_created_; |
| 274 | 270 |
| 275 // FileSelectHelper, lazily created. | 271 // FileSelectHelper, lazily created. |
| 276 scoped_ptr<FileSelectHelper> file_select_helper_; | 272 scoped_ptr<FileSelectHelper> file_select_helper_; |
| 277 | 273 |
| 278 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); | 274 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |
| 279 }; | 275 }; |
| 280 | 276 |
| 281 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ | 277 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_HOST_H_ |
| OLD | NEW |