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

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

Issue 216053002: Files.app multi-profile: add back migration to old path format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 6 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
« 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 14cebb39d11eedb75281e8d45042365beab969ac..45d107d5f132e7d9b39454703e34fc018b2fa80b 100644
--- a/chrome/browser/chromeos/file_manager/open_util.cc
+++ b/chrome/browser/chromeos/file_manager/open_util.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/chromeos/file_manager/file_tasks.h"
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
#include "chrome/browser/chromeos/file_manager/mime_util.h"
+#include "chrome/browser/chromeos/file_manager/path_util.h"
#include "chrome/browser/chromeos/file_manager/url_util.h"
#include "chrome/browser/extensions/api/file_handlers/app_file_handler_util.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -207,11 +208,18 @@ void OpenRemovableDrive(Profile* profile, const base::FilePath& file_path) {
void OpenItem(Profile* profile, const base::FilePath& file_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ // 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.
+ base::FilePath path;
+ if (!util::MigratePathFromOldFormat(profile, file_path, &path))
+ path = file_path;
+
GURL url;
if (!ConvertAbsoluteFilePathToFileSystemUrl(
- profile, file_path, kFileManagerAppId, &url) ||
+ profile, path, kFileManagerAppId, &url) ||
!GrantFileSystemAccessToFileBrowser(profile)) {
- ShowWarningMessageBox(profile, file_path);
+ ShowWarningMessageBox(profile, path);
return;
}
@@ -220,12 +228,19 @@ void OpenItem(Profile* profile, const base::FilePath& file_path) {
profile, kFileManagerAppId);
CheckIfDirectoryExists(file_system_context, url,
- base::Bind(&ContinueOpenItem, profile, file_path));
+ base::Bind(&ContinueOpenItem, profile, path));
}
void ShowItemInFolder(Profile* profile, const base::FilePath& file_path) {
+ // 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.
+ base::FilePath path;
+ if (!util::MigratePathFromOldFormat(profile, file_path, &path))
+ path = file_path;
+
// This action changes the selection so we do not reuse existing tabs.
- OpenFileManagerWithInternalActionId(profile, file_path, "select");
+ OpenFileManagerWithInternalActionId(profile, path, "select");
}
} // namespace util
« 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