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

Unified Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2681663004: Mustash: Ignore --mash flag when comparing flags in UserSessionManager. (Closed)
Patch Set: Adding braces. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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 b065b22c4e183986ee9b4b70ab037256704b1dc1..6c6b6c440713dd8a4c68a77819884a91615ff2c3 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,37 @@ 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 = false;
+ base::CommandLine user_flags_no_mash = user_flags;
+
+#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
+ in_mash = user_flags.HasSwitch(::switches::kMash);
+ if (in_mash) {
+ base::CommandLine::SwitchMap switches = user_flags.GetSwitches();
+ switches.erase(::switches::kMash);
+ user_flags_no_mash = base::CommandLine(user_flags.GetProgram());
+ for (const std::pair<std::string, base::CommandLine::StringType>& sw :
+ switches) {
+ user_flags_no_mash.AppendSwitchNative(sw.first, sw.second);
+ }
+ }
+#endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
+
if (about_flags::AreSwitchesIdenticalToCurrentCommandLine(
- user_flags, *base::CommandLine::ForCurrentProcess(),
+ user_flags_no_mash, *base::CommandLine::ForCurrentProcess(),
out_command_line_difference)) {
return false;
}
+ // TODO(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;
}

Powered by Google App Engine
This is Rietveld 408576698