| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/values.h" |
| 12 |
| 13 class ExtensionFunction; |
| 14 class RenderViewHost; |
| 15 |
| 16 // ExtensionFunctionDispatcher receives requests to execute functions from |
| 17 // Chromium extensions running in a RenderViewHost and dispatches them to the |
| 18 // appropriate handler. It lives entirely on the UI thread. |
| 19 class ExtensionFunctionDispatcher { |
| 20 public: |
| 21 // Gets a list of all known extension function names. |
| 22 static void GetAllFunctionNames(std::vector<std::string>* names); |
| 23 |
| 24 ExtensionFunctionDispatcher(RenderViewHost* render_view_host); |
| 25 |
| 26 // Handle a request to execute an extension function. |
| 27 void HandleRequest(const std::string& name, const std::string& args, |
| 28 int callback_id); |
| 29 |
| 30 // Send a response to a function. |
| 31 void SendResponse(ExtensionFunction* api); |
| 32 |
| 33 private: |
| 34 RenderViewHost* render_view_host_; |
| 35 }; |
| 36 |
| 37 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_ |
| OLD | NEW |