OLD | NEW |
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 "components/signin/core/browser/child_account_info_fetcher_impl.h" | 5 #include "components/signin/core/browser/child_account_info_fetcher_impl.h" |
6 | 6 |
7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "components/invalidation/public/invalidation_service.h" | 10 #include "components/invalidation/public/invalidation_service.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 void ChildAccountInfoFetcherImpl::OnGetTokenSuccess( | 91 void ChildAccountInfoFetcherImpl::OnGetTokenSuccess( |
92 const OAuth2TokenService::Request* request, | 92 const OAuth2TokenService::Request* request, |
93 const std::string& access_token, | 93 const std::string& access_token, |
94 const base::Time& expiration_time) { | 94 const base::Time& expiration_time) { |
95 TRACE_EVENT_ASYNC_STEP_PAST0("AccountFetcherService", kFetcherId, this, | 95 TRACE_EVENT_ASYNC_STEP_PAST0("AccountFetcherService", kFetcherId, this, |
96 "OnGetTokenSuccess"); | 96 "OnGetTokenSuccess"); |
97 DCHECK_EQ(request, login_token_request_.get()); | 97 DCHECK_EQ(request, login_token_request_.get()); |
98 | 98 |
99 gaia_auth_fetcher_.reset( | 99 gaia_auth_fetcher_ = fetcher_service_->signin_client_->CreateGaiaAuthFetcher( |
100 fetcher_service_->signin_client_->CreateGaiaAuthFetcher( | 100 this, GaiaConstants::kChromeSource, request_context_getter_); |
101 this, GaiaConstants::kChromeSource, request_context_getter_)); | |
102 gaia_auth_fetcher_->StartOAuthLogin(access_token, | 101 gaia_auth_fetcher_->StartOAuthLogin(access_token, |
103 GaiaConstants::kGaiaService); | 102 GaiaConstants::kGaiaService); |
104 } | 103 } |
105 | 104 |
106 void ChildAccountInfoFetcherImpl::OnGetTokenFailure( | 105 void ChildAccountInfoFetcherImpl::OnGetTokenFailure( |
107 const OAuth2TokenService::Request* request, | 106 const OAuth2TokenService::Request* request, |
108 const GoogleServiceAuthError& error) { | 107 const GoogleServiceAuthError& error) { |
109 HandleFailure(); | 108 HandleFailure(); |
110 } | 109 } |
111 | 110 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 171 |
173 void ChildAccountInfoFetcherImpl::OnIncomingInvalidation( | 172 void ChildAccountInfoFetcherImpl::OnIncomingInvalidation( |
174 const syncer::ObjectIdInvalidationMap& invalidation_map) { | 173 const syncer::ObjectIdInvalidationMap& invalidation_map) { |
175 FetchIfNotInProgress(); | 174 FetchIfNotInProgress(); |
176 invalidation_map.AcknowledgeAll(); | 175 invalidation_map.AcknowledgeAll(); |
177 } | 176 } |
178 | 177 |
179 std::string ChildAccountInfoFetcherImpl::GetOwnerName() const { | 178 std::string ChildAccountInfoFetcherImpl::GetOwnerName() const { |
180 return std::string(kFetcherId); | 179 return std::string(kFetcherId); |
181 } | 180 } |
OLD | NEW |