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

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: Rollback unnecessary changes. 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(Profile* profile) { 143 bool ProfileHelper::IsSigninProfile(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 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile); 152 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile);
152 if (!user) 153 if (!user)
153 return false; 154 return false;
154 155
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 user_to_profile_for_testing_[user] = profile; 377 user_to_profile_for_testing_[user] = profile;
377 } 378 }
378 379
379 // static 380 // static
380 std::string ProfileHelper::GetUserIdHashByUserIdForTesting( 381 std::string ProfileHelper::GetUserIdHashByUserIdForTesting(
381 const std::string& user_id) { 382 const std::string& user_id) {
382 return user_id + kUserIdHashSuffix; 383 return user_id + kUserIdHashSuffix;
383 } 384 }
384 385
385 } // namespace chromeos 386 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698