OLD | NEW |
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/extension_cookies_api.h" | 7 #include "chrome/browser/extensions/extension_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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 281 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
282 net::CookieStore* cookie_store = | 282 net::CookieStore* cookie_store = |
283 store_context_->GetURLRequestContext()->cookie_store(); | 283 store_context_->GetURLRequestContext()->cookie_store(); |
284 extension_cookies_helpers::GetCookieListFromStore( | 284 extension_cookies_helpers::GetCookieListFromStore( |
285 cookie_store, url_, | 285 cookie_store, url_, |
286 base::Bind(&GetAllCookiesFunction::GetAllCookiesCallback, this)); | 286 base::Bind(&GetAllCookiesFunction::GetAllCookiesCallback, this)); |
287 } | 287 } |
288 | 288 |
289 void GetAllCookiesFunction::GetAllCookiesCallback( | 289 void GetAllCookiesFunction::GetAllCookiesCallback( |
290 const net::CookieList& cookie_list) { | 290 const net::CookieList& cookie_list) { |
291 const Extension* extension = GetExtension(); | 291 const extensions::Extension* extension = GetExtension(); |
292 if (extension) { | 292 if (extension) { |
293 ListValue* matching_list = new ListValue(); | 293 ListValue* matching_list = new ListValue(); |
294 extension_cookies_helpers::AppendMatchingCookiesToList( | 294 extension_cookies_helpers::AppendMatchingCookiesToList( |
295 cookie_list, store_id_, url_, details_, | 295 cookie_list, store_id_, url_, details_, |
296 GetExtension(), matching_list); | 296 GetExtension(), matching_list); |
297 result_.reset(matching_list); | 297 result_.reset(matching_list); |
298 } | 298 } |
299 bool rv = BrowserThread::PostTask( | 299 bool rv = BrowserThread::PostTask( |
300 BrowserThread::UI, FROM_HERE, | 300 BrowserThread::UI, FROM_HERE, |
301 base::Bind(&GetAllCookiesFunction::RespondOnUIThread, this)); | 301 base::Bind(&GetAllCookiesFunction::RespondOnUIThread, this)); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 extension_cookies_helpers::CreateCookieStoreValue( | 534 extension_cookies_helpers::CreateCookieStoreValue( |
535 incognito_profile, incognito_tab_ids.release())); | 535 incognito_profile, incognito_tab_ids.release())); |
536 } | 536 } |
537 result_.reset(cookie_store_list); | 537 result_.reset(cookie_store_list); |
538 return true; | 538 return true; |
539 } | 539 } |
540 | 540 |
541 void GetAllCookieStoresFunction::Run() { | 541 void GetAllCookieStoresFunction::Run() { |
542 SendResponse(RunImpl()); | 542 SendResponse(RunImpl()); |
543 } | 543 } |
OLD | NEW |