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

Side by Side Diff: chrome/browser/extensions/api/preference/preference_helpers.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, 6 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 (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/api/preference/preference_helpers.h" 5 #include "chrome/browser/extensions/api/preference/preference_helpers.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/extensions/api/preference/preference_api.h" 10 #include "chrome/browser/extensions/api/preference/preference_api.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 restrict_to_profile = profile->GetOffTheRecordProfile(); 119 restrict_to_profile = profile->GetOffTheRecordProfile();
120 } else if (!incognito && 120 } else if (!incognito &&
121 PreferenceAPI::Get(profile)->DoesExtensionControlPref( 121 PreferenceAPI::Get(profile)->DoesExtensionControlPref(
122 extension->id(), browser_pref, &from_incognito) && 122 extension->id(), browser_pref, &from_incognito) &&
123 from_incognito) { 123 from_incognito) {
124 restrict_to_profile = profile; 124 restrict_to_profile = profile;
125 } 125 }
126 } 126 }
127 127
128 scoped_ptr<base::ListValue> args_copy(args->DeepCopy()); 128 scoped_ptr<base::ListValue> args_copy(args->DeepCopy());
129 scoped_ptr<Event> event(new Event(event_name, args_copy.Pass())); 129 scoped_ptr<Event> event(
130 new Event(events::UNKNOWN, event_name, args_copy.Pass()));
130 event->restrict_to_browser_context = restrict_to_profile; 131 event->restrict_to_browser_context = restrict_to_profile;
131 router->DispatchEventToExtension(extension->id(), event.Pass()); 132 router->DispatchEventToExtension(extension->id(), event.Pass());
132 } 133 }
133 } 134 }
134 } 135 }
135 136
136 } // namespace preference_helpers 137 } // namespace preference_helpers
137 } // namespace extensions 138 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698