Commit 0dc4cf80 authored by yoshiki's avatar yoshiki Committed by Commit bot

Fix cast from video player by using DriveApiUrlGenerator to generate URL

This patch fixes the regression which is caused by the following CL.
https://chromium.googlesource.com/chromium/src/+/3315eb5fe7bcb9300995dae3326de2d2c5f3c44a

Since the Styx URLs are updated in that CL, we need to use DriveApiUrlGenerator::GenerateDownloadFileURL to create a download URL to pass a cast device.

BUG=477733
TEST=can cast a video

Review URL: https://codereview.chromium.org/1055403004

Cr-Commit-Position: refs/heads/master@{#326999}
parent d4fbd7b5
......@@ -1034,9 +1034,10 @@ void FileManagerPrivateGetDownloadUrlFunction::OnGetResourceEntry(
return;
}
download_url_ =
google_apis::DriveApiUrlGenerator::kBaseDownloadUrlForProduction +
entry->resource_id();
DriveApiUrlGenerator url_generator(
(GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction)),
(GURL(google_apis::DriveApiUrlGenerator::kBaseDownloadUrlForProduction)));
download_url_ = url_generator.GenerateDownloadFileUrl(entry->resource_id());
ProfileOAuth2TokenService* oauth2_token_service =
ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile());
......@@ -1065,7 +1066,8 @@ void FileManagerPrivateGetDownloadUrlFunction::OnTokenFetched(
return;
}
const std::string url = download_url_ + "?access_token=" + access_token;
const std::string url =
download_url_.Resolve("?access_token=" + access_token).spec();
SetResult(new base::StringValue(url));
SendResponse(true);
......
......@@ -240,7 +240,7 @@ class FileManagerPrivateGetDownloadUrlFunction
const std::string& access_token);
private:
std::string download_url_;
GURL download_url_;
scoped_ptr<google_apis::AuthService> auth_service_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment