Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: chrome/browser/signin/cross_device_promo.cc

Issue 1162103003: ListAccounts will return the Gaia ID as well as the email of the account. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/signin/cross_device_promo.h" 5 #include "chrome/browser/signin/cross_device_promo.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 380
381 void CrossDevicePromo::UnregisterForCookieChanges() { 381 void CrossDevicePromo::UnregisterForCookieChanges() {
382 cookie_manager_service_->RemoveObserver(this); 382 cookie_manager_service_->RemoveObserver(this);
383 } 383 }
384 384
385 base::Time CrossDevicePromo::GetTimePref(const std::string& pref) { 385 base::Time CrossDevicePromo::GetTimePref(const std::string& pref) {
386 return base::Time::FromInternalValue(prefs_->GetInt64(pref)); 386 return base::Time::FromInternalValue(prefs_->GetInt64(pref));
387 } 387 }
388 388
389 void CrossDevicePromo::OnGaiaAccountsInCookieUpdated( 389 void CrossDevicePromo::OnGaiaAccountsInCookieUpdated(
390 const std::vector<std::pair<std::string, bool>>& accounts, 390 const std::vector<gaia::ListedAccount>& accounts,
391 const GoogleServiceAuthError& error) { 391 const GoogleServiceAuthError& error) {
392 VLOG(1) << "CrossDevicePromo::OnGaiaAccountsInCookieUpdated. " 392 VLOG(1) << "CrossDevicePromo::OnGaiaAccountsInCookieUpdated. "
393 << accounts.size() << " accounts with auth error " << error.state(); 393 << accounts.size() << " accounts with auth error " << error.state();
394 if (error.state() != GoogleServiceAuthError::State::NONE) 394 if (error.state() != GoogleServiceAuthError::State::NONE)
395 return; 395 return;
396 396
397 // Multiple accounts seen - clear the pref. 397 // Multiple accounts seen - clear the pref.
398 bool single_account = accounts.size() == 1; 398 bool single_account = accounts.size() == 1;
399 bool has_pref = 399 bool has_pref =
400 prefs_->HasPrefPath(prefs::kCrossDevicePromoObservedSingleAccountCookie); 400 prefs_->HasPrefPath(prefs::kCrossDevicePromoObservedSingleAccountCookie);
(...skipping 18 matching lines...) Expand all
419 } 419 }
420 420
421 void CrossDevicePromo::MarkPromoInactive() { 421 void CrossDevicePromo::MarkPromoInactive() {
422 VLOG(1) << "CrossDevicePromo::MarkPromoInactive."; 422 VLOG(1) << "CrossDevicePromo::MarkPromoInactive.";
423 if (prefs_->GetBoolean(prefs::kCrossDevicePromoActive)) { 423 if (prefs_->GetBoolean(prefs::kCrossDevicePromoActive)) {
424 prefs_->SetBoolean(prefs::kCrossDevicePromoActive, false); 424 prefs_->SetBoolean(prefs::kCrossDevicePromoActive, false);
425 FOR_EACH_OBSERVER(CrossDevicePromo::Observer, observer_list_, 425 FOR_EACH_OBSERVER(CrossDevicePromo::Observer, observer_list_,
426 OnPromoActivationChanged(false)); 426 OnPromoActivationChanged(false));
427 } 427 }
428 } 428 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/cross_device_promo.h ('k') | chrome/browser/signin/cross_device_promo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698