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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 23983031: Owner flags storage should not save the flags names but the actual switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 7 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/chromeos/chromeos_version.h" 10 #include "base/chromeos/chromeos_version.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 if (browser_shutdown::IsTryingToQuit()) 242 if (browser_shutdown::IsTryingToQuit())
243 return; 243 return;
244 244
245 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { 245 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) {
246 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); 246 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile);
247 return; 247 return;
248 } 248 }
249 249
250 CommandLine user_flags(CommandLine::NO_PROGRAM); 250 CommandLine user_flags(CommandLine::NO_PROGRAM);
251 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); 251 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs());
252 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags); 252 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags,
253 about_flags::kAddSentinels);
253 // Only restart if needed and if not going into managed mode. 254 // Only restart if needed and if not going into managed mode.
254 // Don't restart browser if it is not first profile in session. 255 // Don't restart browser if it is not first profile in session.
255 if (UserManager::Get()->GetLoggedInUsers().size() == 1 && 256 if (UserManager::Get()->GetLoggedInUsers().size() == 1 &&
256 !UserManager::Get()->IsLoggedInAsLocallyManagedUser() && 257 !UserManager::Get()->IsLoggedInAsLocallyManagedUser() &&
257 !about_flags::AreSwitchesIdenticalToCurrentCommandLine( 258 !about_flags::AreSwitchesIdenticalToCurrentCommandLine(
258 user_flags, *CommandLine::ForCurrentProcess())) { 259 user_flags, *CommandLine::ForCurrentProcess())) {
259 CommandLine::StringVector flags; 260 CommandLine::StringVector flags;
260 // argv[0] is the program name |CommandLine::NO_PROGRAM|. 261 // argv[0] is the program name |CommandLine::NO_PROGRAM|.
261 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); 262 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end());
262 VLOG(1) << "Restarting to apply per-session flags..."; 263 VLOG(1) << "Restarting to apply per-session flags...";
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 bool LoginUtils::IsWhitelisted(const std::string& username) { 790 bool LoginUtils::IsWhitelisted(const std::string& username) {
790 CrosSettings* cros_settings = CrosSettings::Get(); 791 CrosSettings* cros_settings = CrosSettings::Get();
791 bool allow_new_user = false; 792 bool allow_new_user = false;
792 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 793 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
793 if (allow_new_user) 794 if (allow_new_user)
794 return true; 795 return true;
795 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 796 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
796 } 797 }
797 798
798 } // namespace chromeos 799 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/chromeos/settings/owner_flags_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698