| 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/browser/extensions/extension_function_dispatcher.h" | 5 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 struct Static { | 89 struct Static { |
| 90 Static() | 90 Static() |
| 91 : api(extensions::ExtensionAPI::CreateWithDefaultConfiguration()) { | 91 : api(extensions::ExtensionAPI::CreateWithDefaultConfiguration()) { |
| 92 } | 92 } |
| 93 scoped_ptr<extensions::ExtensionAPI> api; | 93 scoped_ptr<extensions::ExtensionAPI> api; |
| 94 }; | 94 }; |
| 95 base::LazyInstance<Static> g_global_io_data = LAZY_INSTANCE_INITIALIZER; | 95 base::LazyInstance<Static> g_global_io_data = LAZY_INSTANCE_INITIALIZER; |
| 96 | 96 |
| 97 } // namespace | 97 } // namespace |
| 98 | 98 |
| 99 Browser* ExtensionFunctionDispatcher::Delegate::GetBrowser() { |
| 100 return NULL; |
| 101 } |
| 102 |
| 103 content::WebContents* |
| 104 ExtensionFunctionDispatcher::Delegate::GetAssociatedWebContents() const { |
| 105 return NULL; |
| 106 } |
| 99 | 107 |
| 100 void ExtensionFunctionDispatcher::GetAllFunctionNames( | 108 void ExtensionFunctionDispatcher::GetAllFunctionNames( |
| 101 std::vector<std::string>* names) { | 109 std::vector<std::string>* names) { |
| 102 ExtensionFunctionRegistry::GetInstance()->GetAllNames(names); | 110 ExtensionFunctionRegistry::GetInstance()->GetAllNames(names); |
| 103 } | 111 } |
| 104 | 112 |
| 105 bool ExtensionFunctionDispatcher::OverrideFunction( | 113 bool ExtensionFunctionDispatcher::OverrideFunction( |
| 106 const std::string& name, ExtensionFunctionFactory factory) { | 114 const std::string& name, ExtensionFunctionFactory factory) { |
| 107 return ExtensionFunctionRegistry::GetInstance()->OverrideFunction(name, | 115 return ExtensionFunctionRegistry::GetInstance()->OverrideFunction(name, |
| 108 factory); | 116 factory); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 } | 309 } |
| 302 | 310 |
| 303 // static | 311 // static |
| 304 void ExtensionFunctionDispatcher::SendAccessDenied( | 312 void ExtensionFunctionDispatcher::SendAccessDenied( |
| 305 IPC::Message::Sender* ipc_sender, int routing_id, int request_id) { | 313 IPC::Message::Sender* ipc_sender, int routing_id, int request_id) { |
| 306 ListValue empty_list; | 314 ListValue empty_list; |
| 307 ipc_sender->Send(new ExtensionMsg_Response( | 315 ipc_sender->Send(new ExtensionMsg_Response( |
| 308 routing_id, request_id, false, empty_list, | 316 routing_id, request_id, false, empty_list, |
| 309 "Access to extension API denied.")); | 317 "Access to extension API denied.")); |
| 310 } | 318 } |
| OLD | NEW |