| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/api/preference/chrome_direct_setting_api.h" | 5 #include "chrome/browser/extensions/api/preference/chrome_direct_setting_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); | 138 scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); |
| 139 result->Set(preference_api_constants::kValue, value->DeepCopy()); | 139 result->Set(preference_api_constants::kValue, value->DeepCopy()); |
| 140 base::ListValue args; | 140 base::ListValue args; |
| 141 args.Append(result.release()); | 141 args.Append(result.release()); |
| 142 | 142 |
| 143 for (const scoped_refptr<const extensions::Extension>& extension : | 143 for (const scoped_refptr<const extensions::Extension>& extension : |
| 144 ExtensionRegistry::Get(profile_)->enabled_extensions()) { | 144 ExtensionRegistry::Get(profile_)->enabled_extensions()) { |
| 145 const std::string& extension_id = extension->id(); | 145 const std::string& extension_id = extension->id(); |
| 146 if (router->ExtensionHasEventListener(extension_id, event_name)) { | 146 if (router->ExtensionHasEventListener(extension_id, event_name)) { |
| 147 scoped_ptr<base::ListValue> args_copy(args.DeepCopy()); | 147 scoped_ptr<base::ListValue> args_copy(args.DeepCopy()); |
| 148 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); | 148 scoped_ptr<Event> event( |
| 149 new Event(events::UNKNOWN, event_name, args_copy.Pass())); |
| 149 router->DispatchEventToExtension(extension_id, event.Pass()); | 150 router->DispatchEventToExtension(extension_id, event.Pass()); |
| 150 } | 151 } |
| 151 } | 152 } |
| 152 } | 153 } |
| 153 } | 154 } |
| 154 | 155 |
| 155 } // namespace chromedirectsetting | 156 } // namespace chromedirectsetting |
| 156 } // namespace extensions | 157 } // namespace extensions |
| OLD | NEW |