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

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

Issue 442833002: Disallow Easy Unlock in secondary user profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 bool ProfileHelper::IsOwnerProfile(Profile* profile) { 170 bool ProfileHelper::IsOwnerProfile(Profile* profile) {
171 if (!profile) 171 if (!profile)
172 return false; 172 return false;
173 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile); 173 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile);
174 if (!user) 174 if (!user)
175 return false; 175 return false;
176 176
177 return user->email() == chromeos::UserManager::Get()->GetOwnerEmail(); 177 return user->email() == chromeos::UserManager::Get()->GetOwnerEmail();
178 } 178 }
179 179
180 //static
181 bool ProfileHelper::IsPrimaryProfile(Profile* profile) {
182 if (!profile)
183 return false;
184 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile);
185 if (!user)
186 return false;
187 return user == chromeos::UserManager::Get()->GetPrimaryUser();
188 }
189
180 void ProfileHelper::ProfileStartup(Profile* profile, bool process_startup) { 190 void ProfileHelper::ProfileStartup(Profile* profile, bool process_startup) {
181 // Initialize Chrome OS preferences like touch pad sensitivity. For the 191 // Initialize Chrome OS preferences like touch pad sensitivity. For the
182 // preferences to work in the guest mode, the initialization has to be 192 // preferences to work in the guest mode, the initialization has to be
183 // done after |profile| is switched to the incognito profile (which 193 // done after |profile| is switched to the incognito profile (which
184 // is actually GuestSessionProfile in the guest mode). See the 194 // is actually GuestSessionProfile in the guest mode). See the
185 // GetOffTheRecordProfile() call above. 195 // GetOffTheRecordProfile() call above.
186 profile->InitChromeOSPreferences(); 196 profile->InitChromeOSPreferences();
187 197
188 // Add observer so we can see when the first profile's session restore is 198 // Add observer so we can see when the first profile's session restore is
189 // completed. After that, we won't need the default profile anymore. 199 // completed. After that, we won't need the default profile anymore.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 ProfileHelper::SetProfileToUserForTestingEnabled(true); 365 ProfileHelper::SetProfileToUserForTestingEnabled(true);
356 } 366 }
357 367
358 void ProfileHelper::SetUserToProfileMappingForTesting( 368 void ProfileHelper::SetUserToProfileMappingForTesting(
359 const user_manager::User* user, 369 const user_manager::User* user,
360 Profile* profile) { 370 Profile* profile) {
361 user_to_profile_for_testing_[user] = profile; 371 user_to_profile_for_testing_[user] = profile;
362 } 372 }
363 373
364 } // namespace chromeos 374 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698