| Index: chrome/browser/chromeos/login/session/user_session_manager.cc
|
| diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| index 61c3de9feb182e269cc116c0439633da34662e5a..845d8b5b313468c6269788398da147810a8db16d 100644
|
| --- a/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
|
| @@ -77,6 +77,7 @@
|
| #include "chrome/browser/ui/app_list/app_list_service.h"
|
| #include "chrome/browser/ui/ash/ash_util.h"
|
| #include "chrome/browser/ui/startup/startup_browser_creator.h"
|
| +#include "chrome/common/channel_info.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/logging_chrome.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -107,6 +108,7 @@
|
| #include "components/user_manager/user_manager.h"
|
| #include "components/user_manager/user_names.h"
|
| #include "components/user_manager/user_type.h"
|
| +#include "components/version_info/version_info.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/browser/storage_partition.h"
|
| @@ -284,12 +286,32 @@ bool NeedRestartToApplyPerSessionFlags(
|
| if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser())
|
| return false;
|
|
|
| + // When running Mus+ash, the flags stored in Profile Prefs will contain
|
| + // --mash, while the browser command line will not (and should not) have
|
| + // it, so ignore it for the purpose of comparison.
|
| + // TODO(mfomitchev): Find a better way. crbug.com/690083
|
| + bool in_mash = user_flags.HasSwitch(::switches::kMash);
|
| + base::CommandLine user_flags_no_mash = user_flags;
|
| + if (in_mash) {
|
| + user_flags_no_mash = base::CommandLine(user_flags.GetProgram());
|
| + base::CommandLine::SwitchMap switches = user_flags.GetSwitches();
|
| + switches.erase(::switches::kMash);
|
| + user_flags_no_mash = base::CommandLine(user_flags.GetProgram());
|
| + for (const auto& sw : switches)
|
| + user_flags_no_mash.AppendSwitchNative(sw.first, sw.second);
|
| + }
|
| +
|
| if (about_flags::AreSwitchesIdenticalToCurrentCommandLine(
|
| - user_flags, *base::CommandLine::ForCurrentProcess(),
|
| + user_flags_no_mash, *base::CommandLine::ForCurrentProcess(),
|
| out_command_line_difference)) {
|
| return false;
|
| }
|
|
|
| + // TODO(jamescook, mfomitchev): Browser restart doesn't currently work in
|
| + // Mus+ash. So if we are running Mustash and we need to restart - just crash
|
| + // right here. crbug.com/690140
|
| + CHECK(!in_mash);
|
| +
|
| return true;
|
| }
|
|
|
|
|