| 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 #include "chrome/browser/chromeos/login/profile_auth_data.h" | 5 #include "chrome/browser/chromeos/login/profile_auth_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // To re-create the original cookie, a domain should only be passed in to | 43 // To re-create the original cookie, a domain should only be passed in to |
| 44 // SetCookieWithDetailsAsync if cookie.Domain() has a leading period, to | 44 // SetCookieWithDetailsAsync if cookie.Domain() has a leading period, to |
| 45 // re-create the original cookie. | 45 // re-create the original cookie. |
| 46 std::string domain; | 46 std::string domain; |
| 47 if (!cookie.Domain().empty() && cookie.Domain()[0] == '.') | 47 if (!cookie.Domain().empty() && cookie.Domain()[0] == '.') |
| 48 domain = cookie.Domain(); | 48 domain = cookie.Domain(); |
| 49 | 49 |
| 50 cookie_store->SetCookieWithDetailsAsync( | 50 cookie_store->SetCookieWithDetailsAsync( |
| 51 cookie.Source(), cookie.Name(), cookie.Value(), domain, cookie.Path(), | 51 cookie.Source(), cookie.Name(), cookie.Value(), domain, cookie.Path(), |
| 52 cookie.CreationDate(), cookie.ExpiryDate(), cookie.LastAccessDate(), | 52 cookie.CreationDate(), cookie.ExpiryDate(), cookie.LastAccessDate(), |
| 53 cookie.IsSecure(), cookie.IsHttpOnly(), cookie.IsSameSite(), | 53 cookie.IsSecure(), cookie.IsHttpOnly(), cookie.SameSite(), |
| 54 // enforce_strict_secure should have been applied on the original | 54 // enforce_strict_secure should have been applied on the original |
| 55 // cookie, prior to import. | 55 // cookie, prior to import. |
| 56 false, cookie.Priority(), net::CookieStore::SetCookiesCallback()); | 56 false, cookie.Priority(), net::CookieStore::SetCookiesCallback()); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 class ProfileAuthDataTransferer { | 60 class ProfileAuthDataTransferer { |
| 61 public: | 61 public: |
| 62 ProfileAuthDataTransferer( | 62 ProfileAuthDataTransferer( |
| 63 net::URLRequestContextGetter* from_context, | 63 net::URLRequestContextGetter* from_context, |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 337 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 338 (new ProfileAuthDataTransferer( | 338 (new ProfileAuthDataTransferer( |
| 339 from_context, | 339 from_context, |
| 340 to_context, | 340 to_context, |
| 341 transfer_auth_cookies_and_channel_ids_on_first_login, | 341 transfer_auth_cookies_and_channel_ids_on_first_login, |
| 342 transfer_saml_auth_cookies_on_subsequent_login, | 342 transfer_saml_auth_cookies_on_subsequent_login, |
| 343 completion_callback))->BeginTransfer(); | 343 completion_callback))->BeginTransfer(); |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace chromeos | 346 } // namespace chromeos |
| OLD | NEW |