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

Side by Side Diff: chrome/browser/chromeos/profiles/profile_helper.cc

Issue 933503004: Always load signin profile on Chrome OS startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nits. Created 5 years, 10 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
OLDNEW
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 base::FilePath ProfileHelper::GetUserProfileDir( 134 base::FilePath ProfileHelper::GetUserProfileDir(
135 const std::string& user_id_hash) { 135 const std::string& user_id_hash) {
136 CHECK(!user_id_hash.empty()); 136 CHECK(!user_id_hash.empty());
137 return ShouldAddProfileDirPrefix(user_id_hash) 137 return ShouldAddProfileDirPrefix(user_id_hash)
138 ? base::FilePath(chrome::kProfileDirPrefix + user_id_hash) 138 ? base::FilePath(chrome::kProfileDirPrefix + user_id_hash)
139 : base::FilePath(user_id_hash); 139 : base::FilePath(user_id_hash);
140 } 140 }
141 141
142 // static 142 // static
143 bool ProfileHelper::IsSigninProfile(const Profile* profile) { 143 bool ProfileHelper::IsSigninProfile(const Profile* profile) {
144 return profile->GetPath().BaseName().value() == chrome::kInitialProfile; 144 return profile &&
145 profile->GetPath().BaseName().value() == chrome::kInitialProfile;
145 } 146 }
146 147
147 // static 148 // static
148 bool ProfileHelper::IsOwnerProfile(Profile* profile) { 149 bool ProfileHelper::IsOwnerProfile(Profile* profile) {
149 if (!profile) 150 if (!profile)
150 return false; 151 return false;
151 const user_manager::User* user = 152 const user_manager::User* user =
152 ProfileHelper::Get()->GetUserByProfile(profile); 153 ProfileHelper::Get()->GetUserByProfile(profile);
153 if (!user) 154 if (!user)
154 return false; 155 return false;
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 user_to_profile_for_testing_[user] = profile; 383 user_to_profile_for_testing_[user] = profile;
383 } 384 }
384 385
385 // static 386 // static
386 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( 387 std::string ProfileHelper::GetUserIdHashByUserIdForTesting(
387 const std::string& user_id) { 388 const std::string& user_id) {
388 return user_id + kUserIdHashSuffix; 389 return user_id + kUserIdHashSuffix;
389 } 390 }
390 391
391 } // namespace chromeos 392 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698