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 "components/browser_sync/browser/profile_sync_service.h" | 5 #include "components/browser_sync/browser/profile_sync_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 2107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2118 syncer::STOP_SOURCE_LIMIT); | 2118 syncer::STOP_SOURCE_LIMIT); |
2119 RequestStop(CLEAR_DATA); | 2119 RequestStop(CLEAR_DATA); |
2120 } | 2120 } |
2121 | 2121 |
2122 void ProfileSyncService::OnGaiaAccountsInCookieUpdated( | 2122 void ProfileSyncService::OnGaiaAccountsInCookieUpdated( |
2123 const std::vector<gaia::ListedAccount>& accounts, | 2123 const std::vector<gaia::ListedAccount>& accounts, |
2124 const GoogleServiceAuthError& error) { | 2124 const GoogleServiceAuthError& error) { |
2125 if (!IsBackendInitialized()) | 2125 if (!IsBackendInitialized()) |
2126 return; | 2126 return; |
2127 | 2127 |
2128 bool cookie_mismatch = true; | 2128 bool cookie_jar_mismatch = true; |
| 2129 bool cookie_jar_empty = accounts.size() == 0; |
2129 std::string account_id = signin_->GetAccountIdToUse(); | 2130 std::string account_id = signin_->GetAccountIdToUse(); |
2130 | 2131 |
2131 // Iterate through list of accounts, looking for current sync account. | 2132 // Iterate through list of accounts, looking for current sync account. |
2132 for (const auto& account : accounts) { | 2133 for (const auto& account : accounts) { |
2133 if (account.gaia_id == account_id) { | 2134 if (account.gaia_id == account_id) { |
2134 cookie_mismatch = false; | 2135 cookie_jar_mismatch = false; |
2135 break; | 2136 break; |
2136 } | 2137 } |
2137 } | 2138 } |
2138 | 2139 |
2139 DVLOG(1) << "Cookie jar mismatch: " << cookie_mismatch; | 2140 DVLOG(1) << "Cookie jar mismatch: " << cookie_jar_mismatch; |
2140 backend_->OnCookieJarChanged(cookie_mismatch); | 2141 DVLOG(1) << "Cookie jar empty: " << cookie_jar_empty; |
| 2142 backend_->OnCookieJarChanged(cookie_jar_mismatch, cookie_jar_empty); |
2141 } | 2143 } |
2142 | 2144 |
2143 void ProfileSyncService::AddObserver( | 2145 void ProfileSyncService::AddObserver( |
2144 sync_driver::SyncServiceObserver* observer) { | 2146 sync_driver::SyncServiceObserver* observer) { |
2145 observers_.AddObserver(observer); | 2147 observers_.AddObserver(observer); |
2146 } | 2148 } |
2147 | 2149 |
2148 void ProfileSyncService::RemoveObserver( | 2150 void ProfileSyncService::RemoveObserver( |
2149 sync_driver::SyncServiceObserver* observer) { | 2151 sync_driver::SyncServiceObserver* observer) { |
2150 observers_.RemoveObserver(observer); | 2152 observers_.RemoveObserver(observer); |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2530 } | 2532 } |
2531 | 2533 |
2532 std::string ProfileSyncService::unrecoverable_error_message() const { | 2534 std::string ProfileSyncService::unrecoverable_error_message() const { |
2533 return unrecoverable_error_message_; | 2535 return unrecoverable_error_message_; |
2534 } | 2536 } |
2535 | 2537 |
2536 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() | 2538 tracked_objects::Location ProfileSyncService::unrecoverable_error_location() |
2537 const { | 2539 const { |
2538 return unrecoverable_error_location_; | 2540 return unrecoverable_error_location_; |
2539 } | 2541 } |
OLD | NEW |