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

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

Issue 17526006: Disable browser restart just after login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, 244 void LoginUtilsImpl::DoBrowserLaunch(Profile* profile,
245 LoginDisplayHost* login_host) { 245 LoginDisplayHost* login_host) {
246 if (browser_shutdown::IsTryingToQuit()) 246 if (browser_shutdown::IsTryingToQuit())
247 return; 247 return;
248 248
249 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { 249 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) {
250 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); 250 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile);
251 return; 251 return;
252 } 252 }
253 253
254 CommandLine user_flags(CommandLine::NO_PROGRAM);
Nikita (slow) 2013/06/21 10:49:24 Let's leave this code and put it behind ifdef inst
Dmitry Polukhin 2013/06/21 10:59:31 Done.
255 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs());
256 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags);
257 if (!about_flags::AreSwitchesIdenticalToCurrentCommandLine(
258 user_flags, *CommandLine::ForCurrentProcess())) {
259 CommandLine::StringVector flags;
260 // argv[0] is the program name |CommandLine::NO_PROGRAM|.
261 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end());
262 VLOG(1) << "Restarting to apply per-session flags...";
263 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser(
264 UserManager::Get()->GetActiveUser()->email(), flags);
265 chrome::ExitCleanly();
266 return;
267 }
268
269 if (login_host) { 254 if (login_host) {
270 login_host->SetStatusAreaVisible(true); 255 login_host->SetStatusAreaVisible(true);
271 login_host->BeforeSessionStart(); 256 login_host->BeforeSessionStart();
272 } 257 }
273 258
274 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); 259 BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false);
275 260
276 VLOG(1) << "Launching browser..."; 261 VLOG(1) << "Launching browser...";
277 StartupBrowserCreator browser_creator; 262 StartupBrowserCreator browser_creator;
278 int return_code; 263 int return_code;
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 bool LoginUtils::IsWhitelisted(const std::string& username) { 781 bool LoginUtils::IsWhitelisted(const std::string& username) {
797 CrosSettings* cros_settings = CrosSettings::Get(); 782 CrosSettings* cros_settings = CrosSettings::Get();
798 bool allow_new_user = false; 783 bool allow_new_user = false;
799 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 784 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
800 if (allow_new_user) 785 if (allow_new_user)
801 return true; 786 return true;
802 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); 787 return cros_settings->FindEmailInList(kAccountsPrefUsers, username);
803 } 788 }
804 789
805 } // namespace chromeos 790 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698