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

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

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, reland Created 8 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 | 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 "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 cookies_helpers::GetURLFromCanonicalCookie(*details->cookie); 108 cookies_helpers::GetURLFromCanonicalCookie(*details->cookie);
109 DispatchEvent(profile, keys::kOnChanged, json_args, cookie_domain); 109 DispatchEvent(profile, keys::kOnChanged, json_args, cookie_domain);
110 } 110 }
111 111
112 void ExtensionCookiesEventRouter::DispatchEvent(Profile* profile, 112 void ExtensionCookiesEventRouter::DispatchEvent(Profile* profile,
113 const char* event_name, 113 const char* event_name,
114 const std::string& json_args, 114 const std::string& json_args,
115 GURL& cookie_domain) { 115 GURL& cookie_domain) {
116 if (profile && profile->GetExtensionEventRouter()) { 116 if (profile && profile->GetExtensionEventRouter()) {
117 profile->GetExtensionEventRouter()->DispatchEventToRenderers( 117 profile->GetExtensionEventRouter()->DispatchEventToRenderers(
118 event_name, json_args, profile, cookie_domain); 118 event_name, json_args, profile, cookie_domain, EventFilteringInfo());
119 } 119 }
120 } 120 }
121 121
122 bool CookiesFunction::ParseUrl(const DictionaryValue* details, GURL* url, 122 bool CookiesFunction::ParseUrl(const DictionaryValue* details, GURL* url,
123 bool check_host_permissions) { 123 bool check_host_permissions) {
124 DCHECK(details && url); 124 DCHECK(details && url);
125 std::string url_string; 125 std::string url_string;
126 // Get the URL string or return false. 126 // Get the URL string or return false.
127 EXTENSION_FUNCTION_VALIDATE(details->GetString(keys::kUrlKey, &url_string)); 127 EXTENSION_FUNCTION_VALIDATE(details->GetString(keys::kUrlKey, &url_string));
128 *url = GURL(url_string); 128 *url = GURL(url_string);
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 } 538 }
539 result_.reset(cookie_store_list); 539 result_.reset(cookie_store_list);
540 return true; 540 return true;
541 } 541 }
542 542
543 void GetAllCookieStoresFunction::Run() { 543 void GetAllCookieStoresFunction::Run() {
544 SendResponse(RunImpl()); 544 SendResponse(RunImpl());
545 } 545 }
546 546
547 } // namespace extensions 547 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_manager_extension_api.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698