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_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 bool IsAdblockPlusWithWebRequestInstalled() const { | 115 bool IsAdblockPlusWithWebRequestInstalled() const { |
116 return webrequest_adblock_plus_; | 116 return webrequest_adblock_plus_; |
117 } | 117 } |
118 bool IsOtherExtensionWithWebRequestInstalled() const { | 118 bool IsOtherExtensionWithWebRequestInstalled() const { |
119 return webrequest_other_; | 119 return webrequest_other_; |
120 } | 120 } |
121 | 121 |
122 void OnExtensionResponse(int request_id, | 122 void OnExtensionResponse(int request_id, |
123 bool success, | 123 bool success, |
124 const base::ListValue& response, | 124 const base::ListValue& response, |
125 const std::string& error); | 125 const std::string& error, |
| 126 bool user_gesture); |
126 | 127 |
127 // Checks that the current context contains an extension that has permission | 128 // Checks that the current context contains an extension that has permission |
128 // to execute the specified function. If it does not, a v8 exception is thrown | 129 // to execute the specified function. If it does not, a v8 exception is thrown |
129 // and the method returns false. Otherwise returns true. | 130 // and the method returns false. Otherwise returns true. |
130 bool CheckContextAccessToExtensionAPI( | 131 bool CheckContextAccessToExtensionAPI( |
131 const std::string& function_name, ChromeV8Context* context) const; | 132 const std::string& function_name, ChromeV8Context* context) const; |
132 | 133 |
133 // Dispatches the event named |event_name| to all render views. | 134 // Dispatches the event named |event_name| to all render views. |
134 void DispatchEvent(const std::string& extension_id, | 135 void DispatchEvent(const std::string& extension_id, |
135 const std::string& event_name) const; | 136 const std::string& event_name) const; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 315 |
315 // Mapping of port IDs to tabs. If there is no tab, the value would be -1. | 316 // Mapping of port IDs to tabs. If there is no tab, the value would be -1. |
316 std::map<int, int> port_to_tab_id_map_; | 317 std::map<int, int> port_to_tab_id_map_; |
317 | 318 |
318 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 319 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
319 }; | 320 }; |
320 | 321 |
321 } // namespace extensions | 322 } // namespace extensions |
322 | 323 |
323 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 324 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
OLD | NEW |