Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |
| 287 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 289 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
| 288 user_flags, *base::CommandLine::ForCurrentProcess(), | 290 user_flags, *base::CommandLine::ForCurrentProcess(), |
| 289 out_command_line_difference)) { | 291 out_command_line_difference)) { |
| 290 return false; | 292 return false; |
| 291 } | 293 } |
| 292 | 294 |
| 295 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | |
| 296 // TODO(mfomitchev): When running Mustash, the flags stored in Profile Prefs | |
| 297 // will contain --mash, while the browser command line will not (and should | |
| 298 // not) have it. Also, the restart functionality doesn't currently work in | |
| 299 // Mustash. So if we detect that we are running Mustash - just return false. | |
| 300 // crbug.com/644350 | |
| 301 version_info::Channel channel = chrome::GetChannel(); | |
|
James Cook
2017/02/07 21:07:32
Is there any particular reason to do the channel c
mfomitchev
2017/02/07 21:42:59
Just being extra careful to not affect anything in
| |
| 302 if (channel == version_info::Channel::CANARY || | |
| 303 channel == version_info::Channel::UNKNOWN) { | |
| 304 if (out_command_line_difference->find("--mash") != | |
| 305 out_command_line_difference->end()) | |
|
James Cook
2017/02/07 21:07:31
nit: not strictly needed for style guide, but I wo
mfomitchev
2017/02/07 21:42:59
I changed the code - let me know if you still want
| |
| 306 return false; | |
| 307 } | |
| 308 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) | |
| 309 | |
| 293 return true; | 310 return true; |
| 294 } | 311 } |
| 295 | 312 |
| 296 bool CanPerformEarlyRestart() { | 313 bool CanPerformEarlyRestart() { |
| 297 if (!ChromeUserManager::Get() | 314 if (!ChromeUserManager::Get() |
| 298 ->GetCurrentUserFlow() | 315 ->GetCurrentUserFlow() |
| 299 ->SupportsEarlyRestartToApplyFlags()) { | 316 ->SupportsEarlyRestartToApplyFlags()) { |
| 300 return false; | 317 return false; |
| 301 } | 318 } |
| 302 | 319 |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1886 ->browser_policy_connector_chromeos() | 1903 ->browser_policy_connector_chromeos() |
| 1887 ->IsEnterpriseManaged()) { | 1904 ->IsEnterpriseManaged()) { |
| 1888 return false; | 1905 return false; |
| 1889 } | 1906 } |
| 1890 | 1907 |
| 1891 // Do not show end of life notification if this is a guest session | 1908 // Do not show end of life notification if this is a guest session |
| 1892 return !profile->IsGuestSession(); | 1909 return !profile->IsGuestSession(); |
| 1893 } | 1910 } |
| 1894 | 1911 |
| 1895 } // namespace chromeos | 1912 } // namespace chromeos |
| OLD | NEW |