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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_api.cc

Issue 11440004: Remove deprecated extension EventRouter APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 8 years 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 | Annotate | Revision Log
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 void CookiesEventRouter::DispatchEvent( 126 void CookiesEventRouter::DispatchEvent(
127 Profile* profile, 127 Profile* profile,
128 const std::string& event_name, 128 const std::string& event_name,
129 scoped_ptr<ListValue> event_args, 129 scoped_ptr<ListValue> event_args,
130 GURL& cookie_domain) { 130 GURL& cookie_domain) {
131 EventRouter* router = profile ? 131 EventRouter* router = profile ?
132 extensions::ExtensionSystem::Get(profile)->event_router() : NULL; 132 extensions::ExtensionSystem::Get(profile)->event_router() : NULL;
133 if (!router) 133 if (!router)
134 return; 134 return;
135 router->DispatchEventToRenderers(event_name, event_args.Pass(), profile, 135 scoped_ptr<Event> event(new Event(event_name, event_args.Pass()));
136 cookie_domain); 136 event->restrict_to_profile = profile;
137 event->event_url = cookie_domain;
138 router->BroadcastEvent(event.Pass());
137 } 139 }
138 140
139 bool CookiesFunction::ParseUrl(const std::string& url_string, GURL* url, 141 bool CookiesFunction::ParseUrl(const std::string& url_string, GURL* url,
140 bool check_host_permissions) { 142 bool check_host_permissions) {
141 *url = GURL(url_string); 143 *url = GURL(url_string);
142 if (!url->is_valid()) { 144 if (!url->is_valid()) {
143 error_ = ErrorUtils::FormatErrorMessage( 145 error_ = ErrorUtils::FormatErrorMessage(
144 keys::kInvalidUrlError, url_string); 146 keys::kInvalidUrlError, url_string);
145 return false; 147 return false;
146 } 148 }
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 555 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
554 } 556 }
555 557
556 void CookiesAPI::OnListenerAdded( 558 void CookiesAPI::OnListenerAdded(
557 const extensions::EventListenerInfo& details) { 559 const extensions::EventListenerInfo& details) {
558 cookies_event_router_.reset(new CookiesEventRouter(profile_)); 560 cookies_event_router_.reset(new CookiesEventRouter(profile_));
559 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); 561 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
560 } 562 }
561 563
562 } // namespace extensions 564 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698