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

Side by Side Diff: chrome/browser/chromeos/login/session/user_session_manager.cc

Issue 2681663004: Mustash: Ignore --mash flag when comparing flags in UserSessionManager. (Closed)
Patch Set: Updating BUILD.gn 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/session/user_session_manager.h" 5 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #include "chrome/browser/profiles/profile.h" 70 #include "chrome/browser/profiles/profile.h"
71 #include "chrome/browser/profiles/profile_manager.h" 71 #include "chrome/browser/profiles/profile_manager.h"
72 #include "chrome/browser/signin/account_tracker_service_factory.h" 72 #include "chrome/browser/signin/account_tracker_service_factory.h"
73 #include "chrome/browser/signin/easy_unlock_service.h" 73 #include "chrome/browser/signin/easy_unlock_service.h"
74 #include "chrome/browser/signin/signin_manager_factory.h" 74 #include "chrome/browser/signin/signin_manager_factory.h"
75 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" 75 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
76 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa ctory.h" 76 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa ctory.h"
77 #include "chrome/browser/ui/app_list/app_list_service.h" 77 #include "chrome/browser/ui/app_list/app_list_service.h"
78 #include "chrome/browser/ui/ash/ash_util.h" 78 #include "chrome/browser/ui/ash/ash_util.h"
79 #include "chrome/browser/ui/startup/startup_browser_creator.h" 79 #include "chrome/browser/ui/startup/startup_browser_creator.h"
80 #include "chrome/common/channel_info.h"
80 #include "chrome/common/chrome_switches.h" 81 #include "chrome/common/chrome_switches.h"
81 #include "chrome/common/logging_chrome.h" 82 #include "chrome/common/logging_chrome.h"
82 #include "chrome/common/pref_names.h" 83 #include "chrome/common/pref_names.h"
83 #include "chromeos/cert_loader.h" 84 #include "chromeos/cert_loader.h"
84 #include "chromeos/chromeos_switches.h" 85 #include "chromeos/chromeos_switches.h"
85 #include "chromeos/cryptohome/cryptohome_parameters.h" 86 #include "chromeos/cryptohome/cryptohome_parameters.h"
86 #include "chromeos/cryptohome/cryptohome_util.h" 87 #include "chromeos/cryptohome/cryptohome_util.h"
87 #include "chromeos/dbus/cryptohome_client.h" 88 #include "chromeos/dbus/cryptohome_client.h"
88 #include "chromeos/dbus/dbus_thread_manager.h" 89 #include "chromeos/dbus/dbus_thread_manager.h"
89 #include "chromeos/dbus/session_manager_client.h" 90 #include "chromeos/dbus/session_manager_client.h"
(...skipping 10 matching lines...) Expand all
100 #include "components/quirks/quirks_manager.h" 101 #include "components/quirks/quirks_manager.h"
101 #include "components/session_manager/core/session_manager.h" 102 #include "components/session_manager/core/session_manager.h"
102 #include "components/signin/core/account_id/account_id.h" 103 #include "components/signin/core/account_id/account_id.h"
103 #include "components/signin/core/browser/account_tracker_service.h" 104 #include "components/signin/core/browser/account_tracker_service.h"
104 #include "components/signin/core/browser/signin_manager_base.h" 105 #include "components/signin/core/browser/signin_manager_base.h"
105 #include "components/user_manager/known_user.h" 106 #include "components/user_manager/known_user.h"
106 #include "components/user_manager/user.h" 107 #include "components/user_manager/user.h"
107 #include "components/user_manager/user_manager.h" 108 #include "components/user_manager/user_manager.h"
108 #include "components/user_manager/user_names.h" 109 #include "components/user_manager/user_names.h"
109 #include "components/user_manager/user_type.h" 110 #include "components/user_manager/user_type.h"
111 #include "components/version_info/version_info.h"
110 #include "content/public/browser/browser_thread.h" 112 #include "content/public/browser/browser_thread.h"
111 #include "content/public/browser/notification_service.h" 113 #include "content/public/browser/notification_service.h"
112 #include "content/public/browser/storage_partition.h" 114 #include "content/public/browser/storage_partition.h"
113 #include "content/public/common/content_switches.h" 115 #include "content/public/common/content_switches.h"
114 #include "extensions/common/features/feature_session_type.h" 116 #include "extensions/common/features/feature_session_type.h"
115 #include "net/cert/sth_distributor.h" 117 #include "net/cert/sth_distributor.h"
116 #include "rlz/features/features.h" 118 #include "rlz/features/features.h"
117 #include "ui/base/ime/chromeos/input_method_descriptor.h" 119 #include "ui/base/ime/chromeos/input_method_descriptor.h"
118 #include "ui/base/ime/chromeos/input_method_manager.h" 120 #include "ui/base/ime/chromeos/input_method_manager.h"
119 #include "url/gurl.h" 121 #include "url/gurl.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 const base::CommandLine& user_flags, 279 const base::CommandLine& user_flags,
278 std::set<base::CommandLine::StringType>* out_command_line_difference) { 280 std::set<base::CommandLine::StringType>* out_command_line_difference) {
279 // Don't restart browser if it is not first profile in session. 281 // Don't restart browser if it is not first profile in session.
280 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1) 282 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1)
281 return false; 283 return false;
282 284
283 // Only restart if needed and if not going into managed mode. 285 // Only restart if needed and if not going into managed mode.
284 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) 286 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser())
285 return false; 287 return false;
286 288
289 // When running Mus+ash, the flags stored in Profile Prefs will contain
290 // --mash, while the browser command line will not (and should not) have
291 // it, so ignore it for the purpose of comparison.
292 // TODO(mfomitchev): Find a better way. crbug.com/690083
293 bool in_mash = user_flags.HasSwitch(::switches::kMash);
294 base::CommandLine user_flags_no_mash = user_flags;
295 if (in_mash) {
296 user_flags_no_mash = base::CommandLine(user_flags.GetProgram());
297 base::CommandLine::SwitchMap switches = user_flags.GetSwitches();
298 switches.erase(::switches::kMash);
299 user_flags_no_mash = base::CommandLine(user_flags.GetProgram());
300 for (const auto sw : switches)
James Cook 2017/02/08 19:19:51 ditto
mfomitchev 2017/02/08 20:39:24 Done.
301 user_flags_no_mash.AppendSwitchNative(sw.first, sw.second);
302 }
303
287 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( 304 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine(
288 user_flags, *base::CommandLine::ForCurrentProcess(), 305 user_flags_no_mash, *base::CommandLine::ForCurrentProcess(),
289 out_command_line_difference)) { 306 out_command_line_difference)) {
290 return false; 307 return false;
291 } 308 }
292 309
310 // TODO(jamescook, mfomitchev): Browser restart doesn't currently work in
311 // Mus+ash. So if we are running Mustash and we need to restart - just crash
312 // 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
313 CHECK(!in_mash);
314
293 return true; 315 return true;
294 } 316 }
295 317
296 bool CanPerformEarlyRestart() { 318 bool CanPerformEarlyRestart() {
297 if (!ChromeUserManager::Get() 319 if (!ChromeUserManager::Get()
298 ->GetCurrentUserFlow() 320 ->GetCurrentUserFlow()
299 ->SupportsEarlyRestartToApplyFlags()) { 321 ->SupportsEarlyRestartToApplyFlags()) {
300 return false; 322 return false;
301 } 323 }
302 324
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 ->browser_policy_connector_chromeos() 1908 ->browser_policy_connector_chromeos()
1887 ->IsEnterpriseManaged()) { 1909 ->IsEnterpriseManaged()) {
1888 return false; 1910 return false;
1889 } 1911 }
1890 1912
1891 // Do not show end of life notification if this is a guest session 1913 // Do not show end of life notification if this is a guest session
1892 return !profile->IsGuestSession(); 1914 return !profile->IsGuestSession();
1893 } 1915 }
1894 1916
1895 } // namespace chromeos 1917 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698