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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 friend class RenderViewTest; | 115 friend class RenderViewTest; |
116 typedef void (*BindingInstaller)(ModuleSystem* module_system, | 116 typedef void (*BindingInstaller)(ModuleSystem* module_system, |
117 v8::Handle<v8::Object> chrome, | 117 v8::Handle<v8::Object> chrome, |
118 v8::Handle<v8::Object> chrome_hidden); | 118 v8::Handle<v8::Object> chrome_hidden); |
119 | 119 |
120 // RenderProcessObserver implementation: | 120 // RenderProcessObserver implementation: |
121 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; | 121 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
122 virtual void WebKitInitialized() OVERRIDE; | 122 virtual void WebKitInitialized() OVERRIDE; |
123 virtual void IdleNotification() OVERRIDE; | 123 virtual void IdleNotification() OVERRIDE; |
124 | 124 |
| 125 void OnSetChannel(int channel); |
125 void OnMessageInvoke(const std::string& extension_id, | 126 void OnMessageInvoke(const std::string& extension_id, |
126 const std::string& function_name, | 127 const std::string& function_name, |
127 const base::ListValue& args, | 128 const base::ListValue& args, |
128 const GURL& event_url, | 129 const GURL& event_url, |
129 bool user_gesture); | 130 bool user_gesture); |
130 void OnDispatchOnConnect(int target_port_id, | 131 void OnDispatchOnConnect(int target_port_id, |
131 const std::string& channel_name, | 132 const std::string& channel_name, |
132 const std::string& tab_json, | 133 const std::string& tab_json, |
133 const std::string& source_extension_id, | 134 const std::string& source_extension_id, |
134 const std::string& target_extension_id); | 135 const std::string& target_extension_id); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // Cache for the v8 representation of extension API schemas. | 231 // Cache for the v8 representation of extension API schemas. |
231 extensions::V8SchemaRegistry v8_schema_registry_; | 232 extensions::V8SchemaRegistry v8_schema_registry_; |
232 | 233 |
233 // Bindings that are defined lazily and have BindingInstallers to install | 234 // Bindings that are defined lazily and have BindingInstallers to install |
234 // them. | 235 // them. |
235 std::map<std::string, BindingInstaller> lazy_bindings_map_; | 236 std::map<std::string, BindingInstaller> lazy_bindings_map_; |
236 | 237 |
237 // Sends API requests to the extension host. | 238 // Sends API requests to the extension host. |
238 scoped_ptr<ExtensionRequestSender> request_sender_; | 239 scoped_ptr<ExtensionRequestSender> request_sender_; |
239 | 240 |
| 241 // The current channel. From VersionInfo::GetChannel(). |
| 242 // TODO(aa): Remove when we can restrict non-permission APIs to dev-only. |
| 243 int chrome_channel_; |
| 244 |
240 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); | 245 DISALLOW_COPY_AND_ASSIGN(ExtensionDispatcher); |
241 }; | 246 }; |
242 | 247 |
243 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ | 248 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_DISPATCHER_H_ |
OLD | NEW |