| 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | 15 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 16 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 16 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 17 | 17 |
| 18 class AccountId; | |
| 19 | |
| 20 namespace chromeos { | 18 namespace chromeos { |
| 21 | 19 |
| 22 class ChromeUserSelectionScreen | 20 class ChromeUserSelectionScreen |
| 23 : public UserSelectionScreen, | 21 : public UserSelectionScreen, |
| 24 public policy::DeviceLocalAccountPolicyService::Observer { | 22 public policy::DeviceLocalAccountPolicyService::Observer { |
| 25 public: | 23 public: |
| 26 explicit ChromeUserSelectionScreen(const std::string& display_type); | 24 explicit ChromeUserSelectionScreen(const std::string& display_type); |
| 27 ~ChromeUserSelectionScreen() override; | 25 ~ChromeUserSelectionScreen() override; |
| 28 | 26 |
| 29 // UserSelectionScreen: | 27 // UserSelectionScreen: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 void CheckForPublicSessionDisplayNameChange( | 38 void CheckForPublicSessionDisplayNameChange( |
| 41 policy::DeviceLocalAccountPolicyBroker* broker); | 39 policy::DeviceLocalAccountPolicyBroker* broker); |
| 42 | 40 |
| 43 // Check whether the list of recommended locales set by policy for a public | 41 // Check whether the list of recommended locales set by policy for a public |
| 44 // session has changed and if so, notify the UI. | 42 // session has changed and if so, notify the UI. |
| 45 void CheckForPublicSessionLocalePolicyChange( | 43 void CheckForPublicSessionLocalePolicyChange( |
| 46 policy::DeviceLocalAccountPolicyBroker* broker); | 44 policy::DeviceLocalAccountPolicyBroker* broker); |
| 47 | 45 |
| 48 // Notify the UI that the display name for a public session has changed, | 46 // Notify the UI that the display name for a public session has changed, |
| 49 // taking the display name from the |User| owned by |UserManager|. | 47 // taking the display name from the |User| owned by |UserManager|. |
| 50 void SetPublicSessionDisplayName(const AccountId& account_id); | 48 void SetPublicSessionDisplayName(const std::string& user_id); |
| 51 | 49 |
| 52 // Send an updated list of locales for a public session to the UI, consisting | 50 // Send an updated list of locales for a public session to the UI, consisting |
| 53 // of the |recommended_locales| followed by all other available locales. | 51 // of the |recommended_locales| followed by all other available locales. |
| 54 void SetPublicSessionLocales( | 52 void SetPublicSessionLocales( |
| 55 const AccountId& account_id, | 53 const std::string& user_id, |
| 56 const std::vector<std::string>& recommended_locales); | 54 const std::vector<std::string>& recommended_locales); |
| 57 | 55 |
| 58 bool handler_initialized_; | 56 bool handler_initialized_; |
| 59 | 57 |
| 60 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; | 58 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; |
| 61 | 59 |
| 62 // Map from public session account IDs to their display names set by policy. | 60 // Map from public session user IDs to their display names set by policy. |
| 63 typedef std::map<AccountId, std::string> DisplayNamesMap; | 61 typedef std::map<std::string, std::string> DisplayNamesMap; |
| 64 DisplayNamesMap public_session_display_names_; | 62 DisplayNamesMap public_session_display_names_; |
| 65 | 63 |
| 66 base::WeakPtrFactory<ChromeUserSelectionScreen> weak_factory_; | 64 base::WeakPtrFactory<ChromeUserSelectionScreen> weak_factory_; |
| 67 | 65 |
| 68 DISALLOW_COPY_AND_ASSIGN(ChromeUserSelectionScreen); | 66 DISALLOW_COPY_AND_ASSIGN(ChromeUserSelectionScreen); |
| 69 }; | 67 }; |
| 70 | 68 |
| 71 } // namespace chromeos | 69 } // namespace chromeos |
| 72 | 70 |
| 73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ | 71 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ |
| OLD | NEW |