OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 |
| 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" |
| 14 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 15 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 16 |
| 17 namespace chromeos { |
| 18 |
| 19 class ChromeUserSelectionScreen |
| 20 : public UserSelectionScreen, |
| 21 public policy::DeviceLocalAccountPolicyService::Observer { |
| 22 public: |
| 23 ChromeUserSelectionScreen(); |
| 24 virtual ~ChromeUserSelectionScreen(); |
| 25 |
| 26 // UserSelectionScreen: |
| 27 virtual void Init(const user_manager::UserList& users, |
| 28 bool show_guest) OVERRIDE; |
| 29 virtual void SendUserList() OVERRIDE; |
| 30 |
| 31 // policy::DeviceLocalAccountPolicyService::Observer: |
| 32 virtual void OnPolicyUpdated(const std::string& user_id) OVERRIDE; |
| 33 virtual void OnDeviceLocalAccountsChanged() OVERRIDE; |
| 34 |
| 35 private: |
| 36 // Check whether the display name set by policy for a public session has |
| 37 // changed and if so, notify the UI. |
| 38 void CheckForPublicSessionDisplayNameChange( |
| 39 policy::DeviceLocalAccountPolicyBroker* broker); |
| 40 |
| 41 // Notify the UI that the display name for a public session has changed, |
| 42 // taking the display name from the |User| owned by |UserManager|. |
| 43 void SetPublicSessionDisplayName(const std::string& user_id); |
| 44 |
| 45 bool handler_initialized_; |
| 46 |
| 47 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; |
| 48 |
| 49 // Map from public session user IDs to their display names set by policy. |
| 50 typedef std::map<std::string, std::string> DisplayNamesMap; |
| 51 DisplayNamesMap public_session_display_names_; |
| 52 |
| 53 base::WeakPtrFactory<ChromeUserSelectionScreen> weak_factory_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(ChromeUserSelectionScreen); |
| 56 }; |
| 57 |
| 58 } // namespace chromeos |
| 59 |
| 60 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_CHROME_USER_SELECTION_SCREEN_H_ |
OLD | NEW |