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

Side by Side Diff: chrome/browser/extensions/event_router_forwarder.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 (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/event_router_forwarder.h" 5 #include "chrome/browser/extensions/event_router_forwarder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Profile* restrict_to_profile, 114 Profile* restrict_to_profile,
115 const GURL& event_url) { 115 const GURL& event_url) {
116 #if defined(OS_CHROMEOS) 116 #if defined(OS_CHROMEOS)
117 // Extension does not exist for chromeos login. This needs to be 117 // Extension does not exist for chromeos login. This needs to be
118 // removed once we have an extension service for login screen. 118 // removed once we have an extension service for login screen.
119 // crosbug.com/12856. 119 // crosbug.com/12856.
120 if (!extensions::EventRouter::Get(profile)) 120 if (!extensions::EventRouter::Get(profile))
121 return; 121 return;
122 #endif 122 #endif
123 123
124 scoped_ptr<Event> event(new Event(event_name, event_args.Pass())); 124 scoped_ptr<Event> event(
125 new Event(events::UNKNOWN, event_name, event_args.Pass()));
125 event->restrict_to_browser_context = restrict_to_profile; 126 event->restrict_to_browser_context = restrict_to_profile;
126 event->event_url = event_url; 127 event->event_url = event_url;
127 if (extension_id.empty()) { 128 if (extension_id.empty()) {
128 extensions::EventRouter::Get(profile)->BroadcastEvent(event.Pass()); 129 extensions::EventRouter::Get(profile)->BroadcastEvent(event.Pass());
129 } else { 130 } else {
130 extensions::EventRouter::Get(profile) 131 extensions::EventRouter::Get(profile)
131 ->DispatchEventToExtension(extension_id, event.Pass()); 132 ->DispatchEventToExtension(extension_id, event.Pass());
132 } 133 }
133 } 134 }
134 135
135 } // namespace extensions 136 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698