Chromium Code Reviews| 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..3dc9d2649afe78553588dd43ddcbd7af6bc56c9f 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) |
|
James Cook
2017/02/08 19:19:51
ditto
mfomitchev
2017/02/08 20:39:24
Done.
|
| + 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/678683 |
|
Alexander Alekseev
2017/02/08 19:23:39
crbug.com/678683 says about rebooting.
This is dif
mfomitchev
2017/02/08 20:39:24
Ok, done. Just to clarify, if we crash chrome and
James Cook
2017/02/08 20:46:06
Alexander can comment, but at least in mash there
Alexander Alekseev
2017/02/08 21:41:57
If the crash is deterministic, yes it will happen
|
| + CHECK(!in_mash); |
| + |
| return true; |
| } |