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

Side by Side Diff: chrome/browser/chromeos/login/mount_manager.cc

Issue 286933002: [cros login] Split login related classes into subfolders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in new tests Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/login/mount_manager.h"
6
7 #include "chrome/browser/chromeos/login/user_manager.h"
8 #include "chrome/browser/chromeos/profiles/profile_helper.h"
9
10 namespace chromeos {
11
12 MountManager* MountManager::Get() {
13 if (!instance_)
14 instance_ = new MountManager();
15 return instance_;
16 }
17
18 // static
19 MountManager* MountManager::instance_ = NULL;
20
21 base::FilePath MountManager::GetHomeDir(std::string& user_hash) {
22 return ProfileHelper::GetProfilePathByUserIdHash(user_hash);
23 }
24
25 MountManager::MountManager() {}
26
27 MountManager::~MountManager() {}
28
29 bool MountManager::IsMounted(const std::string& user_id) {
30 UserToPathMap::iterator i(additional_mounts_.find(user_id));
31 return i != additional_mounts_.end();
32 }
33
34 base::FilePath MountManager::GetPath(const std::string& user_id) {
35 UserToPathMap::iterator i(additional_mounts_.find(user_id));
36 DCHECK(i != additional_mounts_.end());
37 return (i == additional_mounts_.end()) ? base::FilePath() : i->second;
38 }
39
40 void MountManager::SetPath(const std::string& user_id,
41 const base::FilePath& path) {
42 additional_mounts_[user_id] = path;
43 }
44
45 void MountManager::DeletePath(const std::string& user_id) {
46 additional_mounts_.erase(user_id);
47 }
48
49 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/mount_manager.h ('k') | chrome/browser/chromeos/login/multi_profile_user_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698