| 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/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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 : std::string(), | 392 : std::string(), |
| 393 parsed_args_->details.domain.get() ? *parsed_args_->details.domain | 393 parsed_args_->details.domain.get() ? *parsed_args_->details.domain |
| 394 : std::string(), | 394 : std::string(), |
| 395 parsed_args_->details.path.get() ? *parsed_args_->details.path | 395 parsed_args_->details.path.get() ? *parsed_args_->details.path |
| 396 : std::string(), | 396 : std::string(), |
| 397 expiration_time, | 397 expiration_time, |
| 398 parsed_args_->details.secure.get() ? *parsed_args_->details.secure.get() | 398 parsed_args_->details.secure.get() ? *parsed_args_->details.secure.get() |
| 399 : false, | 399 : false, |
| 400 parsed_args_->details.http_only.get() ? *parsed_args_->details.http_only | 400 parsed_args_->details.http_only.get() ? *parsed_args_->details.http_only |
| 401 : false, | 401 : false, |
| 402 // TODO(mkwst): If we decide to ship First-party-only cookies, we'll need |
| 403 // to extend the extension API to support them. For the moment, we'll set |
| 404 // all cookies as non-First-party-only. |
| 405 false, |
| 402 net::COOKIE_PRIORITY_DEFAULT, | 406 net::COOKIE_PRIORITY_DEFAULT, |
| 403 base::Bind(&CookiesSetFunction::PullCookie, this)); | 407 base::Bind(&CookiesSetFunction::PullCookie, this)); |
| 404 } | 408 } |
| 405 | 409 |
| 406 void CookiesSetFunction::PullCookie(bool set_cookie_result) { | 410 void CookiesSetFunction::PullCookie(bool set_cookie_result) { |
| 407 // Pull the newly set cookie. | 411 // Pull the newly set cookie. |
| 408 net::CookieMonster* cookie_monster = | 412 net::CookieMonster* cookie_monster = |
| 409 store_browser_context_->GetURLRequestContext() | 413 store_browser_context_->GetURLRequestContext() |
| 410 ->cookie_store() | 414 ->cookie_store() |
| 411 ->GetCookieMonster(); | 415 ->GetCookieMonster(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 return g_factory.Pointer(); | 582 return g_factory.Pointer(); |
| 579 } | 583 } |
| 580 | 584 |
| 581 void CookiesAPI::OnListenerAdded( | 585 void CookiesAPI::OnListenerAdded( |
| 582 const extensions::EventListenerInfo& details) { | 586 const extensions::EventListenerInfo& details) { |
| 583 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); | 587 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); |
| 584 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 588 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 585 } | 589 } |
| 586 | 590 |
| 587 } // namespace extensions | 591 } // namespace extensions |
| OLD | NEW |