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

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

Issue 13586012: drive: Enable a hook to update the default download directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c78d41eb6f2582ba5b662de06ff98ae33d6eab61 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_util.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_util.cc
@@ -232,19 +232,21 @@ bool IsUnderDriveMountPoint(const base::FilePath& path) {
}
bool NeedsNamespaceMigration(const base::FilePath& path) {
- return false;
- // TODO(haruki): Update this along with http://crbug.com/174233.
- // return IsUnderDriveMountPoint(path) &&
- // !(GetDriveMyDriveMountPointPath() == path ||
- // GetDriveMyDriveMountPointPath().IsParent(path));
+ // Before migration, "My Drive" which was represented as "drive.
+ // The user might use some path pointing a directory in "My Drive".
+ // e.g. "drive/downloads_dir"
+ // We changed the path for the "My Drive" to "drive/root", hence the user pref
+ // pointing to the old path needs update to the new path.
+ // e.g. "drive/root/downloads_dir"
+ // If |path| already points to some directory in "drive/root", there's no need
+ // to update it.
+ return IsUnderDriveMountPoint(path) &&
+ !(GetDriveMyDriveMountPointPath() == path ||
+ GetDriveMyDriveMountPointPath().IsParent(path));
}
base::FilePath ConvertToMyDriveNamespace(const base::FilePath& path) {
- // Double check the path.
- // TODO(haruki): Update this with DCHECK(NeedsNamespaceMigration(path)).
- DCHECK(IsUnderDriveMountPoint(path) &&
- !(GetDriveMyDriveMountPointPath() == path ||
- GetDriveMyDriveMountPointPath().IsParent(path)));
+ DCHECK(NeedsNamespaceMigration(path));
// Need to migrate "/special/drive(.*)" to "/special/drive/root(.*)".
// Append the relative path from "/special/drive".
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_file_system_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698