Index: chrome/browser/chromeos/login/login_utils.cc |
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc |
index 2b4fc51e7cb680b866f93b94aab246f018d2823e..974246887c2ffa53a79c5b54b6bd0f5977ca0af4 100644 |
--- a/chrome/browser/chromeos/login/login_utils.cc |
+++ b/chrome/browser/chromeos/login/login_utils.cc |
@@ -48,6 +48,7 @@ |
#include "chrome/browser/extensions/extension_service.h" |
#include "chrome/browser/first_run/first_run.h" |
#include "chrome/browser/google/google_util_chromeos.h" |
+#include "chrome/browser/lifetime/application_lifetime.h" |
#include "chrome/browser/managed_mode/managed_mode.h" |
#include "chrome/browser/net/chrome_url_request_context.h" |
#include "chrome/browser/net/preconnect.h" |
@@ -280,6 +281,20 @@ void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, |
if (browser_shutdown::IsTryingToQuit()) |
return; |
+ CommandLine user_flags(CommandLine::NO_PROGRAM); |
+ about_flags::ConvertFlagsToSwitches(profile->GetPrefs(), &user_flags); |
+ if (!about_flags::CompareSwitchesToCurrentCommandLine( |
+ user_flags, *CommandLine::ForCurrentProcess())) { |
+ CommandLine::StringVector flags; |
+ // argv[0] is the program name |CommandLine::NO_PROGRAM|. |
+ flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); |
+ VLOG(1) << "Restarting to apply per-session flags..."; |
+ DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( |
+ UserManager::Get()->GetActiveUser()->email(), flags); |
Mattias Nissler (ping if slow)
2013/06/12 14:53:03
Is this now a synchronous call? Not sure that's al
pastarmovj
2013/06/12 16:19:33
It is. I checked with out calls around the session
Mattias Nissler (ping if slow)
2013/06/13 16:55:57
I think there's actually an effort going on to con
pastarmovj
2013/06/13 17:29:36
Sure I will check with him but from my understandi
|
+ chrome::ExitCleanly(); |
+ return; |
+ } |
+ |
if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { |
UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); |
return; |
@@ -298,9 +313,6 @@ void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, |
chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? |
chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; |
- // TODO(pastarmovj): Restart the browser and apply any flags set by the user. |
- // See: http://crosbug.com/39249 |
- |
browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
profile, |
base::FilePath(), |