| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 flags_ui::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); | 271 flags_ui::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); |
| 270 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, | 272 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, |
| 271 flags_ui::kAddSentinels); | 273 flags_ui::kAddSentinels); |
| 272 return user_flags; | 274 return user_flags; |
| 273 } | 275 } |
| 274 | 276 |
| 275 // Returns true if restart is needed to apply per-session flags. | 277 // Returns true if restart is needed to apply per-session flags. |
| 276 bool NeedRestartToApplyPerSessionFlags( | 278 bool NeedRestartToApplyPerSessionFlags( |
| 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) { |
| 281 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 282 // TODO(mfomitchev): When running Mustash, the flags stored in Profile Prefs |
| 283 // will contain --mash, while the browser command line will not (and should |
| 284 // not) have it. Also, the restart functionality doesn't currently work in |
| 285 // Mustash. So if we detect that we are running Mustash - just return false. |
| 286 // crbug.com/644350 |
| 287 version_info::Channel channel = chrome::GetChannel(); |
| 288 if (channel == version_info::Channel::CANARY || |
| 289 channel == version_info::Channel::UNKNOWN) { |
| 290 if (user_flags.HasSwitch(::switches::kMash)) |
| 291 return false; |
| 292 } |
| 293 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) |
| 294 |
| 279 // Don't restart browser if it is not first profile in session. | 295 // Don't restart browser if it is not first profile in session. |
| 280 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1) | 296 if (user_manager::UserManager::Get()->GetLoggedInUsers().size() != 1) |
| 281 return false; | 297 return false; |
| 282 | 298 |
| 283 // Only restart if needed and if not going into managed mode. | 299 // Only restart if needed and if not going into managed mode. |
| 284 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) | 300 if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) |
| 285 return false; | 301 return false; |
| 286 | 302 |
| 287 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 303 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
| 288 user_flags, *base::CommandLine::ForCurrentProcess(), | 304 user_flags, *base::CommandLine::ForCurrentProcess(), |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 ->browser_policy_connector_chromeos() | 1902 ->browser_policy_connector_chromeos() |
| 1887 ->IsEnterpriseManaged()) { | 1903 ->IsEnterpriseManaged()) { |
| 1888 return false; | 1904 return false; |
| 1889 } | 1905 } |
| 1890 | 1906 |
| 1891 // Do not show end of life notification if this is a guest session | 1907 // Do not show end of life notification if this is a guest session |
| 1892 return !profile->IsGuestSession(); | 1908 return !profile->IsGuestSession(); |
| 1893 } | 1909 } |
| 1894 | 1910 |
| 1895 } // namespace chromeos | 1911 } // namespace chromeos |
| OLD | NEW |