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" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Initialize Chrome OS preferences like touch pad sensitivity. For the | 169 // Initialize Chrome OS preferences like touch pad sensitivity. For the |
170 // preferences to work in the guest mode, the initialization has to be | 170 // preferences to work in the guest mode, the initialization has to be |
171 // done after |profile| is switched to the incognito profile (which | 171 // done after |profile| is switched to the incognito profile (which |
172 // is actually GuestSessionProfile in the guest mode). See the | 172 // is actually GuestSessionProfile in the guest mode). See the |
173 // GetOffTheRecordProfile() call above. | 173 // GetOffTheRecordProfile() call above. |
174 profile->InitChromeOSPreferences(); | 174 profile->InitChromeOSPreferences(); |
175 | 175 |
176 // Add observer so we can see when the first profile's session restore is | 176 // Add observer so we can see when the first profile's session restore is |
177 // completed. After that, we won't need the default profile anymore. | 177 // completed. After that, we won't need the default profile anymore. |
178 if (!IsSigninProfile(profile) && | 178 if (!IsSigninProfile(profile) && |
179 user_manager::UserManager::Get()->IsLoggedInAsRegularUser() && | 179 user_manager::UserManager::Get()->IsLoggedInAsUserWithGaiaAccount() && |
180 !user_manager::UserManager::Get()->IsLoggedInAsStub()) { | 180 !user_manager::UserManager::Get()->IsLoggedInAsStub()) { |
181 chromeos::OAuth2LoginManager* login_manager = | 181 chromeos::OAuth2LoginManager* login_manager = |
182 chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile( | 182 chromeos::OAuth2LoginManagerFactory::GetInstance()->GetForProfile( |
183 profile); | 183 profile); |
184 if (login_manager) | 184 if (login_manager) |
185 login_manager->AddObserver(this); | 185 login_manager->AddObserver(this); |
186 } | 186 } |
187 } | 187 } |
188 | 188 |
189 base::FilePath ProfileHelper::GetActiveUserProfileDir() { | 189 base::FilePath ProfileHelper::GetActiveUserProfileDir() { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 user_to_profile_for_testing_[user] = profile; | 376 user_to_profile_for_testing_[user] = profile; |
377 } | 377 } |
378 | 378 |
379 // static | 379 // static |
380 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( | 380 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( |
381 const std::string& user_id) { | 381 const std::string& user_id) { |
382 return user_id + kUserIdHashSuffix; | 382 return user_id + kUserIdHashSuffix; |
383 } | 383 } |
384 | 384 |
385 } // namespace chromeos | 385 } // namespace chromeos |
OLD | NEW |