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

Side by Side Diff: chrome/browser/extensions/api/history/history_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, 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/history/history_api.h" 5 #include "chrome/browser/extensions/api/history/history_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 DispatchEvent(profile_, api::history::OnVisitRemoved::kEventName, 167 DispatchEvent(profile_, api::history::OnVisitRemoved::kEventName,
168 args.Pass()); 168 args.Pass());
169 } 169 }
170 170
171 void HistoryEventRouter::DispatchEvent( 171 void HistoryEventRouter::DispatchEvent(
172 Profile* profile, 172 Profile* profile,
173 const std::string& event_name, 173 const std::string& event_name,
174 scoped_ptr<base::ListValue> event_args) { 174 scoped_ptr<base::ListValue> event_args) {
175 if (profile && extensions::EventRouter::Get(profile)) { 175 if (profile && extensions::EventRouter::Get(profile)) {
176 scoped_ptr<extensions::Event> event(new extensions::Event( 176 scoped_ptr<extensions::Event> event(new extensions::Event(
177 event_name, event_args.Pass())); 177 extensions::events::UNKNOWN, event_name, event_args.Pass()));
178 event->restrict_to_browser_context = profile; 178 event->restrict_to_browser_context = profile;
179 extensions::EventRouter::Get(profile)->BroadcastEvent(event.Pass()); 179 extensions::EventRouter::Get(profile)->BroadcastEvent(event.Pass());
180 } 180 }
181 } 181 }
182 182
183 HistoryAPI::HistoryAPI(content::BrowserContext* context) 183 HistoryAPI::HistoryAPI(content::BrowserContext* context)
184 : browser_context_(context) { 184 : browser_context_(context) {
185 EventRouter* event_router = EventRouter::Get(browser_context_); 185 EventRouter* event_router = EventRouter::Get(browser_context_);
186 event_router->RegisterObserver(this, api::history::OnVisited::kEventName); 186 event_router->RegisterObserver(this, api::history::OnVisited::kEventName);
187 event_router->RegisterObserver(this, 187 event_router->RegisterObserver(this,
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } 457 }
458 458
459 return true; 459 return true;
460 } 460 }
461 461
462 void HistoryDeleteAllFunction::DeleteComplete() { 462 void HistoryDeleteAllFunction::DeleteComplete() {
463 SendAsyncResponse(); 463 SendAsyncResponse();
464 } 464 }
465 465
466 } // namespace extensions 466 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/gcm/gcm_api.cc ('k') | chrome/browser/extensions/api/hotword_private/hotword_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698