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

Side by Side Diff: chrome/browser/chromeos/file_manager/volume_manager.cc

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: . Created 3 years, 6 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 unified diff | Download patch
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 341
342 VolumeManager::~VolumeManager() { 342 VolumeManager::~VolumeManager() {
343 } 343 }
344 344
345 VolumeManager* VolumeManager::Get(content::BrowserContext* context) { 345 VolumeManager* VolumeManager::Get(content::BrowserContext* context) {
346 return VolumeManagerFactory::Get(context); 346 return VolumeManagerFactory::Get(context);
347 } 347 }
348 348
349 void VolumeManager::Initialize() { 349 void VolumeManager::Initialize() {
350 // If in Sign in profile, then skip mounting and listening for mount events. 350 // If in Sign in profile, then skip mounting and listening for mount events.
351 if (chromeos::ProfileHelper::IsSigninProfile(profile_)) 351 if (chromeos::ProfileHelper::IsSigninProfile(profile_) ||
352 chromeos::ProfileHelper::IsLockScreenAppProfile(profile_)) {
352 return; 353 return;
354 }
353 355
354 // Register 'Downloads' folder for the profile to the file system. 356 // Register 'Downloads' folder for the profile to the file system.
355 const base::FilePath downloads = 357 const base::FilePath downloads =
356 file_manager::util::GetDownloadsFolderForProfile(profile_); 358 file_manager::util::GetDownloadsFolderForProfile(profile_);
357 const bool success = RegisterDownloadsMountPoint(profile_, downloads); 359 const bool success = RegisterDownloadsMountPoint(profile_, downloads);
358 DCHECK(success); 360 DCHECK(success);
359 361
360 DoMountEvent(chromeos::MOUNT_ERROR_NONE, 362 DoMountEvent(chromeos::MOUNT_ERROR_NONE,
361 Volume::CreateForDownloads(downloads)); 363 Volume::CreateForDownloads(downloads));
362 364
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 // |mounted_volumes_|, because OnVolumeMounted() will access it. 998 // |mounted_volumes_|, because OnVolumeMounted() will access it.
997 volume_ref = std::move(iter->second); 999 volume_ref = std::move(iter->second);
998 mounted_volumes_.erase(iter); 1000 mounted_volumes_.erase(iter);
999 } 1001 }
1000 1002
1001 for (auto& observer : observers_) 1003 for (auto& observer : observers_)
1002 observer.OnVolumeUnmounted(error_code, volume); 1004 observer.OnVolumeUnmounted(error_code, volume);
1003 } 1005 }
1004 1006
1005 } // namespace file_manager 1007 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698