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