Chromium Code Reviews| 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 11 #include "chrome/browser/chromeos/login/oauth2_login_manager_factory.h" | 11 #include "chrome/browser/chromeos/login/oauth2_login_manager_factory.h" |
| 12 #include "chrome/browser/chromeos/login/owner_key_reloader_service_factory.h" | |
| 12 #include "chrome/browser/chromeos/login/user.h" | 13 #include "chrome/browser/chromeos/login/user.h" |
| 13 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 16 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chromeos/chromeos_switches.h" | 19 #include "chromeos/chromeos_switches.h" |
| 19 | 20 |
| 20 namespace chromeos { | 21 namespace chromeos { |
| 21 | 22 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // Add observer so we can see when the first profile's session restore is | 145 // Add observer so we can see when the first profile's session restore is |
| 145 // completed. After that, we won't need the default profile anymore. | 146 // completed. After that, we won't need the default profile anymore. |
| 146 if (!IsSigninProfile(profile) && | 147 if (!IsSigninProfile(profile) && |
| 147 UserManager::Get()->IsLoggedInAsRegularUser() && | 148 UserManager::Get()->IsLoggedInAsRegularUser() && |
| 148 !UserManager::Get()->IsLoggedInAsStub()) { | 149 !UserManager::Get()->IsLoggedInAsStub()) { |
| 149 chromeos::OAuth2LoginManager* login_manager = | 150 chromeos::OAuth2LoginManager* login_manager = |
| 150 chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile( | 151 chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile( |
| 151 profile); | 152 profile); |
| 152 if (login_manager) | 153 if (login_manager) |
| 153 login_manager->AddObserver(this); | 154 login_manager->AddObserver(this); |
| 155 chromeos::OwnerKeyReloaderServiceFactory::GetInstance()->GetForProfile( | |
|
Mattias Nissler (ping if slow)
2014/05/14 12:18:10
Wouldn't it be simpler to mark the service as auto
ygorshenin1
2014/05/14 15:30:07
Done.
| |
| 156 profile); | |
| 154 } | 157 } |
| 155 } | 158 } |
| 156 | 159 |
| 157 base::FilePath ProfileHelper::GetActiveUserProfileDir() { | 160 base::FilePath ProfileHelper::GetActiveUserProfileDir() { |
| 158 return ProfileHelper::GetUserProfileDir(active_user_id_hash_); | 161 return ProfileHelper::GetUserProfileDir(active_user_id_hash_); |
| 159 } | 162 } |
| 160 | 163 |
| 161 void ProfileHelper::Initialize() { | 164 void ProfileHelper::Initialize() { |
| 162 UserManager::Get()->AddSessionStateObserver(this); | 165 UserManager::Get()->AddSessionStateObserver(this); |
| 163 } | 166 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 //////////////////////////////////////////////////////////////////////////////// | 215 //////////////////////////////////////////////////////////////////////////////// |
| 213 // ProfileHelper, UserManager::UserSessionStateObserver implementation: | 216 // ProfileHelper, UserManager::UserSessionStateObserver implementation: |
| 214 | 217 |
| 215 void ProfileHelper::ActiveUserHashChanged(const std::string& hash) { | 218 void ProfileHelper::ActiveUserHashChanged(const std::string& hash) { |
| 216 active_user_id_hash_ = hash; | 219 active_user_id_hash_ = hash; |
| 217 base::FilePath profile_path = GetProfilePathByUserIdHash(hash); | 220 base::FilePath profile_path = GetProfilePathByUserIdHash(hash); |
| 218 VLOG(1) << "Switching to profile path: " << profile_path.value(); | 221 VLOG(1) << "Switching to profile path: " << profile_path.value(); |
| 219 } | 222 } |
| 220 | 223 |
| 221 } // namespace chromeos | 224 } // namespace chromeos |
| OLD | NEW |