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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_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 (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 // Implements the Chrome Extensions Cookies API. 5 // Implements the Chrome Extensions Cookies API.
6 6
7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 cookie_domain); 186 cookie_domain);
187 } 187 }
188 188
189 void CookiesEventRouter::DispatchEvent(content::BrowserContext* context, 189 void CookiesEventRouter::DispatchEvent(content::BrowserContext* context,
190 const std::string& event_name, 190 const std::string& event_name,
191 scoped_ptr<base::ListValue> event_args, 191 scoped_ptr<base::ListValue> event_args,
192 GURL& cookie_domain) { 192 GURL& cookie_domain) {
193 EventRouter* router = context ? extensions::EventRouter::Get(context) : NULL; 193 EventRouter* router = context ? extensions::EventRouter::Get(context) : NULL;
194 if (!router) 194 if (!router)
195 return; 195 return;
196 scoped_ptr<Event> event(new Event(event_name, event_args.Pass())); 196 scoped_ptr<Event> event(
197 new Event(events::UNKNOWN, event_name, event_args.Pass()));
197 event->restrict_to_browser_context = context; 198 event->restrict_to_browser_context = context;
198 event->event_url = cookie_domain; 199 event->event_url = cookie_domain;
199 router->BroadcastEvent(event.Pass()); 200 router->BroadcastEvent(event.Pass());
200 } 201 }
201 202
202 CookiesGetFunction::CookiesGetFunction() { 203 CookiesGetFunction::CookiesGetFunction() {
203 } 204 }
204 205
205 CookiesGetFunction::~CookiesGetFunction() { 206 CookiesGetFunction::~CookiesGetFunction() {
206 } 207 }
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 return g_factory.Pointer(); 583 return g_factory.Pointer();
583 } 584 }
584 585
585 void CookiesAPI::OnListenerAdded( 586 void CookiesAPI::OnListenerAdded(
586 const extensions::EventListenerInfo& details) { 587 const extensions::EventListenerInfo& details) {
587 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); 588 cookies_event_router_.reset(new CookiesEventRouter(browser_context_));
588 EventRouter::Get(browser_context_)->UnregisterObserver(this); 589 EventRouter::Get(browser_context_)->UnregisterObserver(this);
589 } 590 }
590 591
591 } // namespace extensions 592 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698