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

Side by Side Diff: google_apis/gaia/oauth2_token_service_delegate.cc

Issue 1267843003: Fix reconcilor loop when the primary account is in an auth error state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 5 years, 4 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
« no previous file with comments | « google_apis/gaia/oauth2_token_service_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/profiler/scoped_tracker.h" 5 #include "base/profiler/scoped_tracker.h"
6 #include "google_apis/gaia/oauth2_token_service.h" 6 #include "google_apis/gaia/oauth2_token_service.h"
7 #include "google_apis/gaia/oauth2_token_service_delegate.h" 7 #include "google_apis/gaia/oauth2_token_service_delegate.h"
8 8
9 OAuth2TokenServiceDelegate::ScopedBatchChange::ScopedBatchChange( 9 OAuth2TokenServiceDelegate::ScopedBatchChange::ScopedBatchChange(
10 OAuth2TokenServiceDelegate* delegate) 10 OAuth2TokenServiceDelegate* delegate)
(...skipping 28 matching lines...) Expand all
39 void OAuth2TokenServiceDelegate::AddObserver( 39 void OAuth2TokenServiceDelegate::AddObserver(
40 OAuth2TokenService::Observer* observer) { 40 OAuth2TokenService::Observer* observer) {
41 observer_list_.AddObserver(observer); 41 observer_list_.AddObserver(observer);
42 } 42 }
43 43
44 void OAuth2TokenServiceDelegate::RemoveObserver( 44 void OAuth2TokenServiceDelegate::RemoveObserver(
45 OAuth2TokenService::Observer* observer) { 45 OAuth2TokenService::Observer* observer) {
46 observer_list_.RemoveObserver(observer); 46 observer_list_.RemoveObserver(observer);
47 } 47 }
48 48
49 // static
50 bool OAuth2TokenServiceDelegate::IsError(const GoogleServiceAuthError& error) {
51 // TODO(rogerta): should we distinguish between transient and persistent?
52 return error.state() != GoogleServiceAuthError::NONE;
53 }
54
49 void OAuth2TokenServiceDelegate::StartBatchChanges() { 55 void OAuth2TokenServiceDelegate::StartBatchChanges() {
50 ++batch_change_depth_; 56 ++batch_change_depth_;
51 if (batch_change_depth_ == 1) 57 if (batch_change_depth_ == 1)
52 FOR_EACH_OBSERVER(OAuth2TokenService::Observer, observer_list_, 58 FOR_EACH_OBSERVER(OAuth2TokenService::Observer, observer_list_,
53 OnStartBatchChanges()); 59 OnStartBatchChanges());
54 } 60 }
55 61
56 void OAuth2TokenServiceDelegate::EndBatchChanges() { 62 void OAuth2TokenServiceDelegate::EndBatchChanges() {
57 --batch_change_depth_; 63 --batch_change_depth_;
58 DCHECK_LE(0, batch_change_depth_); 64 DCHECK_LE(0, batch_change_depth_);
(...skipping 29 matching lines...) Expand all
88 94
89 FOR_EACH_OBSERVER(OAuth2TokenService::Observer, observer_list_, 95 FOR_EACH_OBSERVER(OAuth2TokenService::Observer, observer_list_,
90 OnRefreshTokensLoaded()); 96 OnRefreshTokensLoaded());
91 } 97 }
92 98
93 net::URLRequestContextGetter* OAuth2TokenServiceDelegate::GetRequestContext() 99 net::URLRequestContextGetter* OAuth2TokenServiceDelegate::GetRequestContext()
94 const { 100 const {
95 return nullptr; 101 return nullptr;
96 } 102 }
97 103
104 bool OAuth2TokenServiceDelegate::RefreshTokenHasError(
105 const std::string& account_id) const {
106 return false;
107 }
108
98 std::vector<std::string> OAuth2TokenServiceDelegate::GetAccounts() { 109 std::vector<std::string> OAuth2TokenServiceDelegate::GetAccounts() {
99 return std::vector<std::string>(); 110 return std::vector<std::string>();
100 } 111 }
OLDNEW
« no previous file with comments | « google_apis/gaia/oauth2_token_service_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698