OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/chromeos/login/auth_sync_observer.h" | 33 #include "chrome/browser/chromeos/login/auth_sync_observer.h" |
34 #include "chrome/browser/chromeos/login/auth_sync_observer_factory.h" | 34 #include "chrome/browser/chromeos/login/auth_sync_observer_factory.h" |
35 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 35 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
36 #include "chrome/browser/chromeos/login/login_display.h" | 36 #include "chrome/browser/chromeos/login/login_display.h" |
37 #include "chrome/browser/chromeos/login/login_utils.h" | 37 #include "chrome/browser/chromeos/login/login_utils.h" |
38 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" | 38 #include "chrome/browser/chromeos/login/multi_profile_user_controller.h" |
39 #include "chrome/browser/chromeos/login/remove_user_delegate.h" | 39 #include "chrome/browser/chromeos/login/remove_user_delegate.h" |
40 #include "chrome/browser/chromeos/login/supervised_user_manager_impl.h" | 40 #include "chrome/browser/chromeos/login/supervised_user_manager_impl.h" |
41 #include "chrome/browser/chromeos/login/user_image_manager_impl.h" | 41 #include "chrome/browser/chromeos/login/user_image_manager_impl.h" |
42 #include "chrome/browser/chromeos/login/wizard_controller.h" | 42 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 43 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 44 #include "chrome/browser/chromeos/net/network_portal_detector_strategy.h" |
43 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 45 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
44 #include "chrome/browser/chromeos/policy/device_local_account.h" | 46 #include "chrome/browser/chromeos/policy/device_local_account.h" |
45 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" | 47 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" |
46 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 48 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
47 #include "chrome/browser/chromeos/session_length_limiter.h" | 49 #include "chrome/browser/chromeos/session_length_limiter.h" |
48 #include "chrome/browser/managed_mode/chromeos/managed_user_password_service_fac
tory.h" | 50 #include "chrome/browser/managed_mode/chromeos/managed_user_password_service_fac
tory.h" |
49 #include "chrome/browser/managed_mode/chromeos/manager_password_service_factory.
h" | 51 #include "chrome/browser/managed_mode/chromeos/manager_password_service_factory.
h" |
50 #include "chrome/browser/net/nss_context.h" | 52 #include "chrome/browser/net/nss_context.h" |
51 #include "chrome/browser/profiles/profile.h" | 53 #include "chrome/browser/profiles/profile.h" |
52 #include "chrome/browser/profiles/profile_manager.h" | 54 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 1565 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
1564 content::Source<UserManager>(this), | 1566 content::Source<UserManager>(this), |
1565 content::Details<const User>(active_user_)); | 1567 content::Details<const User>(active_user_)); |
1566 | 1568 |
1567 // Owner must be first user in session. DeviceSettingsService can't deal with | 1569 // Owner must be first user in session. DeviceSettingsService can't deal with |
1568 // multiple user and will mix up ownership, crbug.com/230018. | 1570 // multiple user and will mix up ownership, crbug.com/230018. |
1569 if (GetLoggedInUsers().size() == 1) { | 1571 if (GetLoggedInUsers().size() == 1) { |
1570 // Indicate to DeviceSettingsService that the owner key may have become | 1572 // Indicate to DeviceSettingsService that the owner key may have become |
1571 // available. | 1573 // available. |
1572 DeviceSettingsService::Get()->SetUsername(active_user_->email()); | 1574 DeviceSettingsService::Get()->SetUsername(active_user_->email()); |
| 1575 |
| 1576 if (NetworkPortalDetector::IsInitialized()) { |
| 1577 NetworkPortalDetector::Get()->SetStrategy( |
| 1578 PortalDetectorStrategy::STRATEGY_ID_SESSION); |
| 1579 } |
1573 } | 1580 } |
1574 } | 1581 } |
1575 | 1582 |
1576 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( | 1583 User::OAuthTokenStatus UserManagerImpl::LoadUserOAuthStatus( |
1577 const std::string& user_id) const { | 1584 const std::string& user_id) const { |
1578 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1585 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1579 | 1586 |
1580 PrefService* local_state = g_browser_process->local_state(); | 1587 PrefService* local_state = g_browser_process->local_state(); |
1581 const base::DictionaryValue* prefs_oauth_status = | 1588 const base::DictionaryValue* prefs_oauth_status = |
1582 local_state->GetDictionary(kUserOAuthTokenStatus); | 1589 local_state->GetDictionary(kUserOAuthTokenStatus); |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 } | 2103 } |
2097 | 2104 |
2098 void UserManagerImpl::DeleteUser(User* user) { | 2105 void UserManagerImpl::DeleteUser(User* user) { |
2099 const bool is_active_user = (user == active_user_); | 2106 const bool is_active_user = (user == active_user_); |
2100 delete user; | 2107 delete user; |
2101 if (is_active_user) | 2108 if (is_active_user) |
2102 active_user_ = NULL; | 2109 active_user_ = NULL; |
2103 } | 2110 } |
2104 | 2111 |
2105 } // namespace chromeos | 2112 } // namespace chromeos |
OLD | NEW |