| 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 c1f15cdd4523adfc9efe21865952bae46c58ec2a..591b18299de8ae85fd8f2f661b33169d7eea8eb3 100644
|
| --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
|
| +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
|
| @@ -259,13 +259,19 @@ 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();
|
| + // account_id intentionally left empty here.
|
| #endif
|
| }
|
|
|
| @@ -273,7 +279,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));
|
| requests_[type].reset(request.release());
|
| } else {
|
| handler_->SendAccessToken(type, std::string()); // Unknown type.
|
|
|