| 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 #include "chrome/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 module_system->SetLazyField(bind_object, | 883 module_system->SetLazyField(bind_object, |
| 884 bind_name, | 884 bind_name, |
| 885 api_name, | 885 api_name, |
| 886 "binding"); | 886 "binding"); |
| 887 } | 887 } |
| 888 } | 888 } |
| 889 | 889 |
| 890 // NOTE: please use the naming convention "foo_natives" for these. | 890 // NOTE: please use the naming convention "foo_natives" for these. |
| 891 void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system, | 891 void Dispatcher::RegisterNativeHandlers(ModuleSystem* module_system, |
| 892 ChromeV8Context* context) { | 892 ChromeV8Context* context) { |
| 893 module_system->RegisterNativeHandler("event_natives", | 893 module_system->RegisterNativeHandler( |
| 894 scoped_ptr<NativeHandler>(EventBindings::Create(this, context))); | 894 "event_natives", |
| 895 scoped_ptr<NativeHandler>(new EventBindings(this, context))); |
| 895 module_system->RegisterNativeHandler("messaging_natives", | 896 module_system->RegisterNativeHandler("messaging_natives", |
| 896 scoped_ptr<NativeHandler>(MessagingBindings::Get(this, context))); | 897 scoped_ptr<NativeHandler>(MessagingBindings::Get(this, context))); |
| 897 module_system->RegisterNativeHandler("apiDefinitions", | 898 module_system->RegisterNativeHandler("apiDefinitions", |
| 898 scoped_ptr<NativeHandler>(new ApiDefinitionsNatives(this, context))); | 899 scoped_ptr<NativeHandler>(new ApiDefinitionsNatives(this, context))); |
| 899 module_system->RegisterNativeHandler("sendRequest", | 900 module_system->RegisterNativeHandler("sendRequest", |
| 900 scoped_ptr<NativeHandler>( | 901 scoped_ptr<NativeHandler>( |
| 901 new SendRequestNatives(this, request_sender_.get(), context))); | 902 new SendRequestNatives(this, request_sender_.get(), context))); |
| 902 module_system->RegisterNativeHandler("setIcon", | 903 module_system->RegisterNativeHandler("setIcon", |
| 903 scoped_ptr<NativeHandler>( | 904 scoped_ptr<NativeHandler>( |
| 904 new SetIconNatives(this, request_sender_.get(), context))); | 905 new SetIconNatives(this, request_sender_.get(), context))); |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 } | 1698 } |
| 1698 | 1699 |
| 1699 void Dispatcher::ClearPortData(int port_id) { | 1700 void Dispatcher::ClearPortData(int port_id) { |
| 1700 // Only the target port side has entries in |port_to_tab_id_map_|. If | 1701 // Only the target port side has entries in |port_to_tab_id_map_|. If |
| 1701 // |port_id| is a source port, std::map::erase() will just silently fail | 1702 // |port_id| is a source port, std::map::erase() will just silently fail |
| 1702 // here as a no-op. | 1703 // here as a no-op. |
| 1703 port_to_tab_id_map_.erase(port_id); | 1704 port_to_tab_id_map_.erase(port_id); |
| 1704 } | 1705 } |
| 1705 | 1706 |
| 1706 } // namespace extensions | 1707 } // namespace extensions |
| OLD | NEW |