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

Unified Diff: chrome/browser/chromeos/preferences.cc

Issue 13892002: Apply the namespace migration for "selectfile.last_directory" user-pref as well. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unittest Created 7 years, 8 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 | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/preferences.cc
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 791b79ca318851866acb2d7fbda9992093ab01b7..4f40880544aca37365b2c57aced7f3a73664f875 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -368,6 +368,8 @@ void Preferences::InitUserPrefs(PrefServiceSyncable* prefs) {
prefs, callback);
download_default_directory_.Init(prefs::kDownloadDefaultDirectory,
prefs, callback);
+ select_file_last_directory_.Init(prefs::kSelectFileLastDirectory,
+ prefs, callback);
primary_mouse_button_right_.Init(prefs::kPrimaryMouseButtonRight,
prefs, callback);
preferred_languages_.Init(prefs::kLanguagePreferredLanguages,
@@ -581,6 +583,7 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) {
}
if (!pref_name || *pref_name == prefs::kDownloadDefaultDirectory) {
const base::FilePath pref_path = download_default_directory_.GetValue();
+ // TODO(haruki): Remove this when migration completes. crbug.com/229304.
if (drive::util::NeedsNamespaceMigration(pref_path)) {
prefs_->SetFilePath(prefs::kDownloadDefaultDirectory,
drive::util::ConvertToMyDriveNamespace(pref_path));
@@ -597,6 +600,16 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) {
"FileBrowser.DownloadDestination.IsGoogleDrive.Started",
default_download_to_drive);
}
+ if (!pref_name || *pref_name == prefs::kSelectFileLastDirectory) {
+ const base::FilePath pref_path = select_file_last_directory_.GetValue();
+ // This pref can contain a Drive path, which needs to be updated due to
+ // namespaces introduced by crbug.com/174233.
+ // TODO(haruki): Remove this when migration completes. crbug.com/229304.
+ if (drive::util::NeedsNamespaceMigration(pref_path)) {
+ prefs_->SetFilePath(prefs::kSelectFileLastDirectory,
+ drive::util::ConvertToMyDriveNamespace(pref_path));
+ }
+ }
if (!pref_name || *pref_name == prefs::kLanguagePreferredLanguages) {
// Unlike kLanguagePreloadEngines and some other input method
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698