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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system_util.cc

Issue 13401003: chromeos: Replace resource ID in drive URL with path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/drive_file_system_util.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system_util.cc b/chrome/browser/chromeos/drive/drive_file_system_util.cc
index 107525bf7665863f7d3ffbc311d7c89b19a1ad9a..cf4d93859f8eb55c7339b32f075edd9c7f90c6e3 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_util.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_util.cc
@@ -115,18 +115,16 @@ void OpenEditURLUIThread(Profile* profile, const GURL& edit_url) {
void OnGetEntryInfoByResourceId(Profile* profile,
const std::string& resource_id,
DriveFileError error,
- const base::FilePath& /* drive_file_path */,
+ const base::FilePath& drive_file_path,
scoped_ptr<DriveEntryProto> entry_proto) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (error != DRIVE_FILE_OK)
return;
- DCHECK(entry_proto.get());
- const std::string& base_name = entry_proto->base_name();
- const GURL edit_url = GetFileResourceUrl(resource_id, base_name);
+ const GURL edit_url = GetFileResourceUrl(drive_file_path);
OpenEditURLUIThread(profile, edit_url);
- DVLOG(1) << "OnFindEntryByResourceId " << edit_url;
+ DVLOG(1) << "OnGetEntryInfoByResourceId " << edit_url;
}
} // namespace
@@ -179,12 +177,10 @@ const base::FilePath& GetDriveMyDriveMountPointPath() {
return drive_mydrive_mount_path;
}
-GURL GetFileResourceUrl(const std::string& resource_id,
- const std::string& file_name) {
- std::string url(base::StringPrintf(
- "%s:%s",
- chrome::kDriveScheme,
- net::EscapePath(resource_id).c_str()));
+GURL GetFileResourceUrl(const base::FilePath& path) {
+ std::string url(base::StringPrintf("%s:%s",
+ chrome::kDriveScheme,
+ path.AsUTF8Unsafe().c_str()));
kinaba 2013/04/04 08:13:01 Don't we need to, say, net::EscapeUrlEncodedData a
hashimoto 2013/04/04 09:19:33 Oh, I should have tested with files with names con
return GURL(url);
}
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system_util.h ('k') | chrome/browser/chromeos/drive/drive_url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698