Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / mount_manager.cc
blob1a99519dd76840676ed02be4321d27345accd0cc
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.
5 #include "chrome/browser/chromeos/login/mount_manager.h"
7 #include "chrome/browser/chromeos/login/user_manager.h"
8 #include "chrome/browser/chromeos/profiles/profile_helper.h"
10 namespace chromeos {
12 MountManager* MountManager::Get() {
13 if (!instance_)
14 instance_ = new MountManager();
15 return instance_;
18 // static
19 MountManager* MountManager::instance_ = NULL;
21 base::FilePath MountManager::GetHomeDir(std::string& user_hash) {
22 return ProfileHelper::GetProfilePathByUserIdHash(user_hash);
25 MountManager::MountManager() {}
27 MountManager::~MountManager() {}
29 bool MountManager::IsMounted(const std::string& user_id) {
30 UserToPathMap::iterator i(additional_mounts_.find(user_id));
31 return i != additional_mounts_.end();
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;
40 void MountManager::SetPath(const std::string& user_id,
41 const base::FilePath& path) {
42 additional_mounts_[user_id] = path;
45 void MountManager::DeletePath(const std::string& user_id) {
46 additional_mounts_.erase(user_id);
49 } // namespace chromeos