OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool IsAdblockWithWebRequestInstalled() const { | 102 bool IsAdblockWithWebRequestInstalled() const { |
103 return webrequest_adblock_; | 103 return webrequest_adblock_; |
104 } | 104 } |
105 bool IsAdblockPlusWithWebRequestInstalled() const { | 105 bool IsAdblockPlusWithWebRequestInstalled() const { |
106 return webrequest_adblock_plus_; | 106 return webrequest_adblock_plus_; |
107 } | 107 } |
108 bool IsOtherExtensionWithWebRequestInstalled() const { | 108 bool IsOtherExtensionWithWebRequestInstalled() const { |
109 return webrequest_other_; | 109 return webrequest_other_; |
110 } | 110 } |
111 | 111 |
112 void OnExtensionResponse(int request_id, | |
113 bool success, | |
114 const base::ListValue& response, | |
115 const std::string& error); | |
116 | |
117 // Checks that the current context contains an extension that has permission | 112 // Checks that the current context contains an extension that has permission |
118 // to execute the specified function. If it does not, a v8 exception is thrown | 113 // to execute the specified function. If it does not, a v8 exception is thrown |
119 // and the method returns false. Otherwise returns true. | 114 // and the method returns false. Otherwise returns true. |
120 bool CheckCurrentContextAccessToExtensionAPI( | 115 bool CheckCurrentContextAccessToExtensionAPI( |
121 const std::string& function_name) const; | 116 const std::string& function_name) const; |
122 | 117 |
123 private: | 118 private: |
124 friend class RenderViewTest; | 119 friend class RenderViewTest; |
125 typedef void (*BindingInstaller)(ModuleSystem* module_system, | 120 typedef void (*BindingInstaller)(ModuleSystem* module_system, |
126 v8::Handle<v8::Object> chrome, | 121 v8::Handle<v8::Object> chrome, |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 scoped_ptr<ExtensionRequestSender> request_sender_; | 255 scoped_ptr<ExtensionRequestSender> request_sender_; |
261 | 256 |
262 // The current channel. From VersionInfo::GetChannel(). | 257 // The current channel. From VersionInfo::GetChannel(). |
263 // TODO(aa): Remove when we can restrict non-permission APIs to dev-only. | 258 // TODO(aa): Remove when we can restrict non-permission APIs to dev-only. |
264 int chrome_channel_; | 259 int chrome_channel_; |
265 | 260 |
266 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 261 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
267 }; | 262 }; |
268 | 263 |
269 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 264 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
OLD | NEW |