| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/profiles/profile_helper.h" | 5 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 10 #include "chrome/browser/chromeos/cros/network_library.h" | 10 #include "chrome/browser/chromeos/cros/network_library.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 ProfileHelper::ProfileHelper() { | 36 ProfileHelper::ProfileHelper() { |
| 37 } | 37 } |
| 38 | 38 |
| 39 ProfileHelper::~ProfileHelper() { | 39 ProfileHelper::~ProfileHelper() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 Profile* ProfileHelper::GetProfileByUserIdHash( | 43 Profile* ProfileHelper::GetProfileByUserIdHash( |
| 44 const std::string& user_id_hash) { | 44 const std::string& user_id_hash) { |
| 45 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 45 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 46 return profile_manager->GetProfile(base::FilePath(user_id_hash)); | 46 return profile_manager->GetProfile( |
| 47 GetChromeOSProfileDir(base::FilePath(user_id_hash))); |
| 47 } | 48 } |
| 48 | 49 |
| 49 // static | 50 // static |
| 50 Profile* ProfileHelper::GetSigninProfile() { | 51 Profile* ProfileHelper::GetSigninProfile() { |
| 51 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 52 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 52 base::FilePath user_data_dir = profile_manager->user_data_dir(); | 53 base::FilePath user_data_dir = profile_manager->user_data_dir(); |
| 53 base::FilePath signin_profile_dir = | 54 base::FilePath signin_profile_dir = |
| 54 user_data_dir.AppendASCII(chrome::kInitialProfile); | 55 user_data_dir.AppendASCII(chrome::kInitialProfile); |
| 55 return profile_manager->GetProfile(signin_profile_dir)-> | 56 return profile_manager->GetProfile(signin_profile_dir)-> |
| 56 GetOffTheRecordProfile(); | 57 GetOffTheRecordProfile(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 81 | 82 |
| 82 //////////////////////////////////////////////////////////////////////////////// | 83 //////////////////////////////////////////////////////////////////////////////// |
| 83 // ProfileHelper, UserManager::UserSessionStateObserver implementation: | 84 // ProfileHelper, UserManager::UserSessionStateObserver implementation: |
| 84 | 85 |
| 85 void ProfileHelper::ActiveUserHashChanged(const std::string& hash) { | 86 void ProfileHelper::ActiveUserHashChanged(const std::string& hash) { |
| 86 active_user_id_hash_ = hash; | 87 active_user_id_hash_ = hash; |
| 87 LOG(INFO) << "Switching to custom profile_dir: " << active_user_id_hash_; | 88 LOG(INFO) << "Switching to custom profile_dir: " << active_user_id_hash_; |
| 88 } | 89 } |
| 89 | 90 |
| 90 } // namespace chromeos | 91 } // namespace chromeos |
| OLD | NEW |