Chromium Code Reviews| Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| index d6dae2b8e70f402a7864c19d05096e0a818c544a..608744c00571689eed09c35fc570ff69b17d7b8f 100644 |
| --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc |
| @@ -259,10 +259,15 @@ class PrintPreviewHandler::AccessTokenService |
| return; // Already in progress. |
| OAuth2TokenService* service = NULL; |
| + std::string account_id; |
| if (type == "profile") { |
| Profile* profile = Profile::FromWebUI(handler_->web_ui()); |
| - if (profile) |
| - service = ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
| + if (profile) { |
| + ProfileOAuth2TokenService* token_service = |
| + ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
| + account_id = token_service->GetPrimaryAccountId(); |
| + service = token_service; |
| + } |
| } else if (type == "device") { |
| #if defined(OS_CHROMEOS) |
| service = chromeos::DeviceOAuth2TokenServiceFactory::Get(); |
| @@ -273,7 +278,7 @@ class PrintPreviewHandler::AccessTokenService |
| OAuth2TokenService::ScopeSet oauth_scopes; |
| oauth_scopes.insert(cloud_print::kCloudPrintAuth); |
| scoped_ptr<OAuth2TokenService::Request> request( |
| - service->StartRequest(oauth_scopes, this)); |
| + service->StartRequest(account_id, oauth_scopes, this)); |
|
Roger Tawa OOO till Jul 10th
2013/08/26 21:04:53
I the case of chromeos and type=="device", account
fgorski
2013/08/26 23:30:54
It's exactly what I expect to happen. I'll documen
|
| requests_[type].reset(request.release()); |
| } else { |
| handler_->SendAccessToken(type, std::string()); // Unknown type. |