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