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

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

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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 "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
284 net::CookieStore* cookie_store = 284 net::CookieStore* cookie_store =
285 store_context_->GetURLRequestContext()->cookie_store(); 285 store_context_->GetURLRequestContext()->cookie_store();
286 cookies_helpers::GetCookieListFromStore( 286 cookies_helpers::GetCookieListFromStore(
287 cookie_store, url_, 287 cookie_store, url_,
288 base::Bind(&GetAllCookiesFunction::GetAllCookiesCallback, this)); 288 base::Bind(&GetAllCookiesFunction::GetAllCookiesCallback, this));
289 } 289 }
290 290
291 void GetAllCookiesFunction::GetAllCookiesCallback( 291 void GetAllCookiesFunction::GetAllCookiesCallback(
292 const net::CookieList& cookie_list) { 292 const net::CookieList& cookie_list) {
293 const Extension* extension = GetExtension(); 293 const extensions::Extension* extension = GetExtension();
294 if (extension) { 294 if (extension) {
295 ListValue* matching_list = new ListValue(); 295 ListValue* matching_list = new ListValue();
296 cookies_helpers::AppendMatchingCookiesToList( 296 cookies_helpers::AppendMatchingCookiesToList(
297 cookie_list, store_id_, url_, details_, 297 cookie_list, store_id_, url_, details_,
298 GetExtension(), matching_list); 298 GetExtension(), matching_list);
299 result_.reset(matching_list); 299 result_.reset(matching_list);
300 } 300 }
301 bool rv = BrowserThread::PostTask( 301 bool rv = BrowserThread::PostTask(
302 BrowserThread::UI, FROM_HERE, 302 BrowserThread::UI, FROM_HERE,
303 base::Bind(&GetAllCookiesFunction::RespondOnUIThread, this)); 303 base::Bind(&GetAllCookiesFunction::RespondOnUIThread, this));
(...skipping 234 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

Powered by Google App Engine
This is Rietveld 408576698