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

Side by Side Diff: chrome/browser/chromeos/app_mode/startup_app_launcher.cc

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding the AndroidPO2TS update Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/app_mode/startup_app_launcher.h" 5 #include "chrome/browser/chromeos/app_mode/startup_app_launcher.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/json/json_file_value_serializer.h" 9 #include "base/json/json_file_value_serializer.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); 145 net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
146 OnNetworkChanged(net::NetworkChangeNotifier::GetConnectionType()); 146 OnNetworkChanged(net::NetworkChangeNotifier::GetConnectionType());
147 } 147 }
148 148
149 void StartupAppLauncher::InitializeTokenService() { 149 void StartupAppLauncher::InitializeTokenService() {
150 FOR_EACH_OBSERVER(Observer, observer_list_, OnInitializingTokenService()); 150 FOR_EACH_OBSERVER(Observer, observer_list_, OnInitializingTokenService());
151 151
152 ProfileOAuth2TokenService* profile_token_service = 152 ProfileOAuth2TokenService* profile_token_service =
153 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); 153 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
154 if (profile_token_service->RefreshTokenIsAvailable()) { 154 if (profile_token_service->RefreshTokenIsAvailable(
155 profile_token_service->GetPrimaryAccountId())) {
155 InitializeNetwork(); 156 InitializeNetwork();
156 return; 157 return;
157 } 158 }
158 159
159 // At the end of this method, the execution will be put on hold until 160 // At the end of this method, the execution will be put on hold until
160 // ProfileOAuth2TokenService triggers either OnRefreshTokenAvailable or 161 // ProfileOAuth2TokenService triggers either OnRefreshTokenAvailable or
161 // OnRefreshTokensLoaded. Given that we want to handle exactly one event, 162 // OnRefreshTokensLoaded. Given that we want to handle exactly one event,
162 // whichever comes first, both handlers call RemoveObserver on PO2TS. Handling 163 // whichever comes first, both handlers call RemoveObserver on PO2TS. Handling
163 // any of the two events is the only way to resume the execution and enable 164 // any of the two events is the only way to resume the execution and enable
164 // Cleanup method to be called, self-invoking a destructor. In destructor 165 // Cleanup method to be called, self-invoking a destructor. In destructor
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); 291 net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
291 network_wait_timer_.Stop(); 292 network_wait_timer_.Stop();
292 293
293 BeginInstall(); 294 BeginInstall();
294 } else { 295 } else {
295 DVLOG(1) << "Network not running yet!"; 296 DVLOG(1) << "Network not running yet!";
296 } 297 }
297 } 298 }
298 299
299 } // namespace chromeos 300 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698