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

Side by Side Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.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: Fixing a bug affecting ProfileSyncService and CR comments. 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/ui/webui/local_discovery/local_discovery_ui_handler.h" 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/local_discovery/privet_device_lister_impl.h" 10 #include "chrome/browser/local_discovery/privet_device_lister_impl.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 std::string base_url = GetCloudPrintBaseUrl(current_http_client_->GetName()); 191 std::string base_url = GetCloudPrintBaseUrl(current_http_client_->GetName());
192 192
193 GURL automated_claim_url(base::StringPrintf( 193 GURL automated_claim_url(base::StringPrintf(
194 kPrivetAutomatedClaimURLFormat, 194 kPrivetAutomatedClaimURLFormat,
195 base_url.c_str(), 195 base_url.c_str(),
196 token.c_str())); 196 token.c_str()));
197 197
198 Profile* profile = Profile::FromWebUI(web_ui()); 198 Profile* profile = Profile::FromWebUI(web_ui());
199 199
200 if (current_register_user_index_ == kAccountIndexUseOAuth2) { 200 if (current_register_user_index_ == kAccountIndexUseOAuth2) {
201 OAuth2TokenService* token_service = 201 ProfileOAuth2TokenService* token_service =
202 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); 202 ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
203 203
204 if (!token_service) { 204 if (!token_service) {
205 LogRegisterErrorToWeb("Could not get token service"); 205 LogRegisterErrorToWeb("Could not get token service");
206 return; 206 return;
207 } 207 }
208 208
209 confirm_api_call_flow_.reset(new PrivetConfirmApiCallFlow( 209 confirm_api_call_flow_.reset(new PrivetConfirmApiCallFlow(
210 profile->GetRequestContext(), 210 profile->GetRequestContext(),
211 token_service, 211 token_service,
212 token_service->GetPrimaryAccountId(),
212 automated_claim_url, 213 automated_claim_url,
213 base::Bind(&LocalDiscoveryUIHandler::OnConfirmDone, 214 base::Bind(&LocalDiscoveryUIHandler::OnConfirmDone,
214 base::Unretained(this)))); 215 base::Unretained(this))));
215 confirm_api_call_flow_->Start(); 216 confirm_api_call_flow_->Start();
216 } else { 217 } else {
217 if (current_register_user_index_ == 0) { 218 if (current_register_user_index_ == 0) {
218 StartCookieConfirmFlow(current_register_user_index_, 219 StartCookieConfirmFlow(current_register_user_index_,
219 xsrf_token_for_primary_user_, 220 xsrf_token_for_primary_user_,
220 automated_claim_url); 221 automated_claim_url);
221 } else { 222 } else {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 user_index, 398 user_index,
398 xsrf_token, 399 xsrf_token,
399 automated_claim_url, 400 automated_claim_url,
400 base::Bind(&LocalDiscoveryUIHandler::OnConfirmDone, 401 base::Bind(&LocalDiscoveryUIHandler::OnConfirmDone,
401 base::Unretained(this)))); 402 base::Unretained(this))));
402 403
403 confirm_api_call_flow_->Start(); 404 confirm_api_call_flow_->Start();
404 } 405 }
405 406
406 } // namespace local_discovery 407 } // namespace local_discovery
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698