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

Side by Side Diff: chrome/browser/chromeos/file_manager/volume_manager.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, 1 month 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/file_manager/path_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/file_manager/volume_manager.h" 5 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 VolumeManager* VolumeManager::Get(content::BrowserContext* context) { 247 VolumeManager* VolumeManager::Get(content::BrowserContext* context) {
248 return VolumeManagerFactory::Get(context); 248 return VolumeManagerFactory::Get(context);
249 } 249 }
250 250
251 void VolumeManager::Initialize() { 251 void VolumeManager::Initialize() {
252 // If in Sign in profile, then skip mounting and listening for mount events. 252 // If in Sign in profile, then skip mounting and listening for mount events.
253 if (chromeos::ProfileHelper::IsSigninProfile(profile_)) 253 if (chromeos::ProfileHelper::IsSigninProfile(profile_))
254 return; 254 return;
255 255
256 // Path to mount user folders have changed several times. We need to migrate
257 // the old preferences on paths to the new format when needed. For the detail,
258 // see the comments in file_manager::util::MigratePathFromOldFormat,
259 // Note: Preferences related to downloads are handled in download_prefs.cc.
260 // TODO(kinaba): Remove this after several rounds of releases.
261 const base::FilePath old_path =
262 profile_->GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
263 base::FilePath new_path;
264 if (!old_path.empty() &&
265 file_manager::util::MigratePathFromOldFormat(profile_,
266 old_path, &new_path)) {
267 profile_->GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory,
268 new_path);
269 }
270
271 // Register 'Downloads' folder for the profile to the file system. 256 // Register 'Downloads' folder for the profile to the file system.
272 const base::FilePath downloads = 257 const base::FilePath downloads =
273 file_manager::util::GetDownloadsFolderForProfile(profile_); 258 file_manager::util::GetDownloadsFolderForProfile(profile_);
274 const bool success = RegisterDownloadsMountPoint(profile_, downloads); 259 const bool success = RegisterDownloadsMountPoint(profile_, downloads);
275 DCHECK(success); 260 DCHECK(success);
276 261
277 DoMountEvent(chromeos::MOUNT_ERROR_NONE, 262 DoMountEvent(chromeos::MOUNT_ERROR_NONE,
278 CreateDownloadsVolumeInfo(downloads)); 263 CreateDownloadsVolumeInfo(downloads));
279 264
280 // Subscribe to DriveIntegrationService. 265 // Subscribe to DriveIntegrationService.
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 return; 776 return;
792 if (error_code == chromeos::MOUNT_ERROR_NONE) 777 if (error_code == chromeos::MOUNT_ERROR_NONE)
793 mounted_volumes_.erase(volume_info.volume_id); 778 mounted_volumes_.erase(volume_info.volume_id);
794 779
795 FOR_EACH_OBSERVER(VolumeManagerObserver, 780 FOR_EACH_OBSERVER(VolumeManagerObserver,
796 observers_, 781 observers_,
797 OnVolumeUnmounted(error_code, volume_info)); 782 OnVolumeUnmounted(error_code, volume_info));
798 } 783 }
799 784
800 } // namespace file_manager 785 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/path_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698