Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chrome/browser/extensions/api/preference/chrome_direct_setting_api.cc

Issue 1201063002: Set up the infrastructure for Extension event metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaaaase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698