OLD | NEW |
1 // Copyright (c) 2010 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_FUNCTION_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
(...skipping 15 matching lines...) Expand all Loading... |
27 | 27 |
28 // ExtensionFunctionDispatcher receives requests to execute functions from | 28 // ExtensionFunctionDispatcher receives requests to execute functions from |
29 // Chromium extensions running in a RenderViewHost and dispatches them to the | 29 // Chromium extensions running in a RenderViewHost and dispatches them to the |
30 // appropriate handler. It lives entirely on the UI thread. | 30 // appropriate handler. It lives entirely on the UI thread. |
31 class ExtensionFunctionDispatcher { | 31 class ExtensionFunctionDispatcher { |
32 public: | 32 public: |
33 class Delegate { | 33 class Delegate { |
34 public: | 34 public: |
35 // Returns the browser that this delegate is associated with, if any. | 35 // Returns the browser that this delegate is associated with, if any. |
36 // Returns NULL otherwise. | 36 // Returns NULL otherwise. |
37 virtual Browser* GetBrowser() const = 0; | 37 virtual Browser* GetBrowser() = 0; |
38 | 38 |
39 // Returns the native view for this extension view, if any. This may be NULL | 39 // Returns the native view for this extension view, if any. This may be NULL |
40 // if the view is not visible. | 40 // if the view is not visible. |
41 virtual gfx::NativeView GetNativeViewOfHost() = 0; | 41 virtual gfx::NativeView GetNativeViewOfHost() = 0; |
42 | 42 |
43 // Typically, the window is assumed to be the window associated with the | 43 // Typically, the window is assumed to be the window associated with the |
44 // result of GetBrowser(). Implementations may override this behavior with | 44 // result of GetBrowser(). Implementations may override this behavior with |
45 // this method. | 45 // this method. |
46 virtual gfx::NativeWindow GetCustomFrameNativeWindow() { | 46 virtual gfx::NativeWindow GetCustomFrameNativeWindow() { |
47 return NULL; | 47 return NULL; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 // AutomationExtensionFunction requires access to the RenderViewHost | 146 // AutomationExtensionFunction requires access to the RenderViewHost |
147 // associated with us. We make it a friend rather than exposing the | 147 // associated with us. We make it a friend rather than exposing the |
148 // RenderViewHost as a public method as we wouldn't want everyone to | 148 // RenderViewHost as a public method as we wouldn't want everyone to |
149 // start assuming a 1:1 relationship between us and RenderViewHost, | 149 // start assuming a 1:1 relationship between us and RenderViewHost, |
150 // whereas AutomationExtensionFunction is by necessity "tight" with us. | 150 // whereas AutomationExtensionFunction is by necessity "tight" with us. |
151 friend class AutomationExtensionFunction; | 151 friend class AutomationExtensionFunction; |
152 }; | 152 }; |
153 | 153 |
154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
OLD | NEW |