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/sync/credential_cache_service_win.h" | 5 #include "chrome/browser/sync/credential_cache_service_win.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 content::Source<TokenService>(token_service)); | 686 content::Source<TokenService>(token_service)); |
687 registrar_.Add(this, | 687 registrar_.Add(this, |
688 chrome::NOTIFICATION_TOKENS_CLEARED, | 688 chrome::NOTIFICATION_TOKENS_CLEARED, |
689 content::Source<TokenService>(token_service)); | 689 content::Source<TokenService>(token_service)); |
690 } | 690 } |
691 | 691 |
692 void CredentialCacheService::LookForCachedCredentialsInAlternateProfile() { | 692 void CredentialCacheService::LookForCachedCredentialsInAlternateProfile() { |
693 // Attempt to read cached credentials from the alternate profile. If no file | 693 // Attempt to read cached credentials from the alternate profile. If no file |
694 // exists, ReadPrefsAsync() will cause PREF_READ_ERROR_NO_FILE to be returned | 694 // exists, ReadPrefsAsync() will cause PREF_READ_ERROR_NO_FILE to be returned |
695 // after initialization is complete. | 695 // after initialization is complete. |
| 696 FilePath path = GetCredentialPathInAlternateProfile(); |
696 alternate_store_ = new JsonPrefStore( | 697 alternate_store_ = new JsonPrefStore( |
697 GetCredentialPathInAlternateProfile(), | 698 path, |
698 content::BrowserThread::GetMessageLoopProxyForThread( | 699 content::BrowserThread::GetMessageLoopProxyForThread( |
699 content::BrowserThread::FILE)); | 700 content::BrowserThread::FILE)); |
700 alternate_store_observer_ = new AlternateStoreObserver(this, | 701 alternate_store_observer_ = new AlternateStoreObserver(this, |
701 alternate_store_); | 702 alternate_store_); |
702 alternate_store_->ReadPrefsAsync(NULL); | 703 alternate_store_->ReadPrefsAsync(NULL); |
703 } | 704 } |
704 | 705 |
705 bool CredentialCacheService::HasUserSignedOut() { | 706 bool CredentialCacheService::HasUserSignedOut() { |
706 DCHECK(local_store_.get()); | 707 DCHECK(local_store_.get()); |
707 // If HasPref() is false, the user never signed in, since there are no | 708 // If HasPref() is false, the user never signed in, since there are no |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 !HasUserSignedOut() && | 870 !HasUserSignedOut() && |
870 !alternate_google_services_username.empty() && | 871 !alternate_google_services_username.empty() && |
871 !alternate_lsid.empty() && | 872 !alternate_lsid.empty() && |
872 !alternate_sid.empty() && | 873 !alternate_sid.empty() && |
873 !(alternate_encryption_bootstrap_token.empty() && | 874 !(alternate_encryption_bootstrap_token.empty() && |
874 alternate_keystore_encryption_bootstrap_token.empty()) && | 875 alternate_keystore_encryption_bootstrap_token.empty()) && |
875 !service->setup_in_progress(); | 876 !service->setup_in_progress(); |
876 } | 877 } |
877 | 878 |
878 } // namespace syncer | 879 } // namespace syncer |
OLD | NEW |