| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "gfx/native_widget_types.h" | 13 #include "gfx/native_widget_types.h" |
| 14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
| 15 | 15 |
| 16 class Browser; | 16 class Browser; |
| 17 class Extension; | 17 class Extension; |
| 18 class ExtensionDOMUI; | 18 class ExtensionDOMUI; |
| 19 class ExtensionFunction; | 19 class ExtensionFunction; |
| 20 class ExtensionHost; | 20 class ExtensionHost; |
| 21 class ExtensionPopupHost; | |
| 22 class Profile; | 21 class Profile; |
| 23 class RenderViewHost; | 22 class RenderViewHost; |
| 24 class RenderViewHostDelegate; | 23 class RenderViewHostDelegate; |
| 25 class Value; | 24 class Value; |
| 26 | 25 |
| 27 // A factory function for creating new ExtensionFunction instances. | 26 // A factory function for creating new ExtensionFunction instances. |
| 28 typedef ExtensionFunction* (*ExtensionFunctionFactory)(); | 27 typedef ExtensionFunction* (*ExtensionFunctionFactory)(); |
| 29 | 28 |
| 30 // ExtensionFunctionDispatcher receives requests to execute functions from | 29 // ExtensionFunctionDispatcher receives requests to execute functions from |
| 31 // Chromium extensions running in a RenderViewHost and dispatches them to the | 30 // Chromium extensions running in a RenderViewHost and dispatches them to the |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 88 |
| 90 // Send a response to a function. | 89 // Send a response to a function. |
| 91 void SendResponse(ExtensionFunction* api, bool success); | 90 void SendResponse(ExtensionFunction* api, bool success); |
| 92 | 91 |
| 93 // Gets the browser extension functions should operate relative to. For | 92 // Gets the browser extension functions should operate relative to. For |
| 94 // example, for positioning windows, or alert boxes, or creating tabs. | 93 // example, for positioning windows, or alert boxes, or creating tabs. |
| 95 // If |include_incognito| is false, and the appropriate browser is incognito, | 94 // If |include_incognito| is false, and the appropriate browser is incognito, |
| 96 // we will fall back to a regular browser window or NULL if unavailable. | 95 // we will fall back to a regular browser window or NULL if unavailable. |
| 97 Browser* GetBrowser(bool include_incognito); | 96 Browser* GetBrowser(bool include_incognito); |
| 98 | 97 |
| 99 // Get the extension popup hosting environment for the ExtensionHost | |
| 100 // or ExtensionDOMUI associted with this dispatcher. | |
| 101 ExtensionPopupHost* GetPopupHost(); | |
| 102 | |
| 103 // Gets the ExtensionHost associated with this object. In the case of | 98 // Gets the ExtensionHost associated with this object. In the case of |
| 104 // tab hosted extension pages, this will return NULL. | 99 // tab hosted extension pages, this will return NULL. |
| 105 ExtensionHost* GetExtensionHost(); | 100 ExtensionHost* GetExtensionHost(); |
| 106 | 101 |
| 107 // Gets the ExtensionDOMUI associated with this object. In the case of | 102 // Gets the ExtensionDOMUI associated with this object. In the case of |
| 108 // non-tab-hosted extension pages, this will return NULL. | 103 // non-tab-hosted extension pages, this will return NULL. |
| 109 ExtensionDOMUI* GetExtensionDOMUI(); | 104 ExtensionDOMUI* GetExtensionDOMUI(); |
| 110 | 105 |
| 111 // Returns the gfx::NativeWindow that frames the view of the extension | 106 // Returns the gfx::NativeWindow that frames the view of the extension |
| 112 // containing the function dispatcher. This may return NULL. Refer to the | 107 // containing the function dispatcher. This may return NULL. Refer to the |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 145 |
| 151 // AutomationExtensionFunction requires access to the RenderViewHost | 146 // AutomationExtensionFunction requires access to the RenderViewHost |
| 152 // 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 |
| 153 // 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 |
| 154 // start assuming a 1:1 relationship between us and RenderViewHost, | 149 // start assuming a 1:1 relationship between us and RenderViewHost, |
| 155 // whereas AutomationExtensionFunction is by necessity "tight" with us. | 150 // whereas AutomationExtensionFunction is by necessity "tight" with us. |
| 156 friend class AutomationExtensionFunction; | 151 friend class AutomationExtensionFunction; |
| 157 }; | 152 }; |
| 158 | 153 |
| 159 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
| OLD | NEW |