| 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 // Exposes extension APIs into the extension process. | 5 // Exposes extension APIs into the extension process. |
| 6 | 6 |
| 7 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ | 7 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ |
| 8 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ | 8 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "chrome/common/view_types.h" | 14 #include "chrome/common/view_types.h" |
| 15 #include "v8/include/v8.h" | 15 #include "v8/include/v8.h" |
| 16 | 16 |
| 17 class GURL; | 17 class GURL; |
| 18 class URLPattern; | 18 class URLPattern; |
| 19 |
| 20 namespace WebKit { |
| 19 class WebView; | 21 class WebView; |
| 22 } |
| 20 | 23 |
| 21 class ExtensionProcessBindings { | 24 class ExtensionProcessBindings { |
| 22 public: | 25 public: |
| 23 static void SetFunctionNames(const std::vector<std::string>& names); | 26 static void SetFunctionNames(const std::vector<std::string>& names); |
| 24 static v8::Extension* Get(); | 27 static v8::Extension* Get(); |
| 25 | 28 |
| 26 // Handles a response to an API request. | 29 // Handles a response to an API request. |
| 27 static void HandleResponse(int request_id, bool success, | 30 static void HandleResponse(int request_id, bool success, |
| 28 const std::string& response, | 31 const std::string& response, |
| 29 const std::string& error); | 32 const std::string& error); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 static bool CurrentContextHasPermission(const std::string& function_name); | 54 static bool CurrentContextHasPermission(const std::string& function_name); |
| 52 | 55 |
| 53 // Throw a V8 exception indicating that permission to access function_name was | 56 // Throw a V8 exception indicating that permission to access function_name was |
| 54 // denied. Must be called with a valid V8 context in scope. | 57 // denied. Must be called with a valid V8 context in scope. |
| 55 static v8::Handle<v8::Value> ThrowPermissionDeniedException( | 58 static v8::Handle<v8::Value> ThrowPermissionDeniedException( |
| 56 const std::string& function_name); | 59 const std::string& function_name); |
| 57 | 60 |
| 58 // For EXTENSION_* |type| values, adds/replaces a special class name on to | 61 // For EXTENSION_* |type| values, adds/replaces a special class name on to |
| 59 // the document element (e.g. "extension_toolstrip", "extension_mole") so | 62 // the document element (e.g. "extension_toolstrip", "extension_mole") so |
| 60 // that the page can use CSS rules to control its display appropriately. | 63 // that the page can use CSS rules to control its display appropriately. |
| 61 static void SetViewType(WebView* view, ViewType::Type type); | 64 static void SetViewType(WebKit::WebView* view, ViewType::Type type); |
| 62 }; | 65 }; |
| 63 | 66 |
| 64 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ | 67 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_PROCESS_BINDINGS_H_ |
| OLD | NEW |