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

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

Issue 580023003: Rename the drive: scheme with the externalfile: scheme. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/file_system_util.cc
diff --git a/chrome/browser/chromeos/drive/file_system_util.cc b/chrome/browser/chromeos/drive/file_system_util.cc
index a000c6da43a336cbcf966fa6f974cdcc454d938e..b2069225c2795b17771d8a4e88b794a344ef23f7 100644
--- a/chrome/browser/chromeos/drive/file_system_util.cc
+++ b/chrome/browser/chromeos/drive/file_system_util.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/bind.h"
@@ -34,7 +35,6 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/url_constants.h"
#include "chromeos/chromeos_constants.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_thread.h"
@@ -169,34 +169,6 @@ DriveServiceInterface* GetDriveServiceByProfile(Profile* profile) {
return integration_service ? integration_service->drive_service() : NULL;
}
-GURL FilePathToDriveURL(const base::FilePath& path) {
- std::string url(base::StringPrintf("%s:%s",
- chrome::kDriveScheme,
- path.AsUTF8Unsafe().c_str()));
- return GURL(url);
-}
-
-base::FilePath DriveURLToFilePath(const GURL& url) {
- if (!url.is_valid() || url.scheme() != chrome::kDriveScheme)
- return base::FilePath();
- std::string path_string = net::UnescapeURLComponent(
- url.GetContent(), net::UnescapeRule::NORMAL);
- return base::FilePath::FromUTF8Unsafe(path_string);
-}
-
-void MaybeSetDriveURL(Profile* profile, const base::FilePath& path, GURL* url) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- if (!IsUnderDriveMountPoint(path))
- return;
-
- FileSystemInterface* file_system = GetFileSystemByProfile(profile);
- if (!file_system)
- return;
-
- *url = FilePathToDriveURL(util::ExtractDrivePath(path));
-}
-
bool IsUnderDriveMountPoint(const base::FilePath& path) {
return !ExtractDrivePath(path).empty();
}
@@ -308,7 +280,7 @@ void PrepareWritableFileAndRun(Profile* profile,
WriteOnCacheFile(file_system,
ExtractDrivePath(path),
- std::string(), // mime_type
+ std::string(), // mime_type
callback);
}
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_util.h ('k') | chrome/browser/chromeos/drive/file_system_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698