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

Unified Diff: chrome/browser/chromeos/file_manager/open_util.cc

Issue 677373002: Remove migation code for file manager path preference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/path_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_manager/open_util.cc
diff --git a/chrome/browser/chromeos/file_manager/open_util.cc b/chrome/browser/chromeos/file_manager/open_util.cc
index dad853242d6b4dd7ad68aacec4cdd91ebf68d9c0..e32cde0df0d381ccea34fa8a731a830a7a2cd621 100644
--- a/chrome/browser/chromeos/file_manager/open_util.cc
+++ b/chrome/browser/chromeos/file_manager/open_util.cc
@@ -173,24 +173,14 @@ void ContinueOpenItem(Profile* profile,
}
}
-// Converts the |given_path| passed from external callers to the form that the
-// file manager can correctly handle. It first migrates old Drive/Download
-// folder path to the new formats, and then converts path to filesystem URL.
+// Converts the |path| passed from external callers to the filesystem URL
+// that the file manager can correctly handle.
//
// When conversion fails, it shows a warning dialog UI and returns false.
-bool ConvertPath(Profile* profile,
- const base::FilePath& given_path,
- base::FilePath* path,
- GURL* url) {
- // The path may have been stored in preferences in old versions.
- // We need migration here.
- // TODO(kinaba): crbug.com/313539 remove it in the future.
- if (!util::MigratePathFromOldFormat(profile, given_path, path))
- *path = given_path;
-
+bool ConvertPath(Profile* profile, const base::FilePath& path, GURL* url) {
if (!ConvertAbsoluteFilePathToFileSystemUrl(
- profile, *path, kFileManagerAppId, url)) {
- ShowWarningMessageBox(profile, *path,
+ profile, path, kFileManagerAppId, url)) {
+ ShowWarningMessageBox(profile, path,
IDS_FILE_BROWSER_ERROR_UNRESOLVABLE_FILE);
return false;
}
@@ -202,9 +192,8 @@ bool ConvertPath(Profile* profile,
void OpenRemovableDrive(Profile* profile, const base::FilePath& file_path) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- base::FilePath converted_path;
GURL url;
- if (!ConvertPath(profile, file_path, &converted_path, &url))
+ if (!ConvertPath(profile, file_path, &url))
return;
OpenFileManagerWithInternalActionId(profile, url, "auto-open");
@@ -213,23 +202,21 @@ void OpenRemovableDrive(Profile* profile, const base::FilePath& file_path) {
void OpenItem(Profile* profile, const base::FilePath& file_path) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- base::FilePath converted_path;
GURL url;
- if (!ConvertPath(profile, file_path, &converted_path, &url))
+ if (!ConvertPath(profile, file_path, &url))
return;
CheckIfDirectoryExists(
GetFileSystemContextForExtensionId(profile, kFileManagerAppId),
url,
- base::Bind(&ContinueOpenItem, profile, converted_path, url));
+ base::Bind(&ContinueOpenItem, profile, file_path, url));
}
void ShowItemInFolder(Profile* profile, const base::FilePath& file_path) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- base::FilePath converted_path;
GURL url;
- if (!ConvertPath(profile, file_path, &converted_path, &url))
+ if (!ConvertPath(profile, file_path, &url))
return;
// This action changes the selection so we do not reuse existing tabs.
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/path_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698