OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_UI_ASH_LOCK_SCREEN_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_ |
6 #define CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_ | 6 #define CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_ |
7 | 7 |
8 #include "ash/public/interfaces/lock_screen.mojom.h" | 8 #include "ash/public/interfaces/lock_screen.mojom.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "ui/base/ime/chromeos/input_method_manager.h" |
11 | 12 |
12 // Handles method calls delegated back to chrome from ash. Also notifies ash of | 13 // Handles method calls delegated back to chrome from ash. Also notifies ash of |
13 // relevant state changes in chrome. | 14 // relevant state changes in chrome. |
14 class LockScreenClient : public ash::mojom::LockScreenClient { | 15 class LockScreenClient : public ash::mojom::LockScreenClient { |
15 public: | 16 public: |
16 LockScreenClient(); | 17 LockScreenClient(); |
17 ~LockScreenClient() override; | 18 ~LockScreenClient() override; |
18 | 19 |
19 // Handles method calls coming from ash into chrome. | 20 // Handles method calls coming from ash into chrome. |
20 class Delegate { | 21 class Delegate { |
21 public: | 22 public: |
22 Delegate(); | 23 Delegate(); |
23 virtual ~Delegate(); | 24 virtual ~Delegate(); |
| 25 virtual void HandleAuthenticateUser(const AccountId& account_id, |
| 26 const std::string& hashed_password, |
| 27 bool authenticated_by_pin) = 0; |
24 virtual void HandleAttemptUnlock(const AccountId& account_id) = 0; | 28 virtual void HandleAttemptUnlock(const AccountId& account_id) = 0; |
25 virtual void HandleHardlockPod(const AccountId& account_id) = 0; | 29 virtual void HandleHardlockPod(const AccountId& account_id) = 0; |
26 virtual void HandleRecordClickOnLockIcon(const AccountId& account_id) = 0; | 30 virtual void HandleRecordClickOnLockIcon(const AccountId& account_id) = 0; |
| 31 virtual void HandleFocusPod(const AccountId& account_id) = 0; |
| 32 virtual void HandleNoPodFocused() = 0; |
27 | 33 |
28 private: | 34 private: |
29 DISALLOW_COPY_AND_ASSIGN(Delegate); | 35 DISALLOW_COPY_AND_ASSIGN(Delegate); |
30 }; | 36 }; |
31 | 37 |
32 static LockScreenClient* Get(); | 38 static LockScreenClient* Get(); |
33 | 39 |
34 // ash::mojom::LockScreenClient: | 40 // ash::mojom::LockScreenClient: |
35 void AuthenticateUser(const AccountId& account_id, | 41 void AuthenticateUser(const AccountId& account_id, |
36 const std::string& hashed_password, | 42 const std::string& hashed_password, |
37 bool authenticated_by_pin) override; | 43 bool authenticated_by_pin) override; |
38 void AttemptUnlock(const AccountId& account_id) override; | 44 void AttemptUnlock(const AccountId& account_id) override; |
39 void HardlockPod(const AccountId& account_id) override; | 45 void HardlockPod(const AccountId& account_id) override; |
40 void RecordClickOnLockIcon(const AccountId& account_id) override; | 46 void RecordClickOnLockIcon(const AccountId& account_id) override; |
| 47 void FocusPod(const AccountId& account_id) override; |
| 48 void NoPodFocused() override; |
| 49 void LoadWallpaper(const AccountId& account_id) override; |
| 50 void SignOutUser() override; |
| 51 void MaxIncorrectPasswordAttempts(const AccountId& account_id) override; |
41 | 52 |
42 // Wrappers around the mojom::LockScreen interface. | 53 // Wrappers around the mojom::LockScreen interface. |
43 void ShowErrorMessage(int32_t login_attempts, | 54 void ShowErrorMessage(int32_t login_attempts, |
44 const std::string& error_text, | 55 const std::string& error_text, |
45 const std::string& help_link_text, | 56 const std::string& help_link_text, |
46 int32_t help_topic_id); | 57 int32_t help_topic_id); |
47 void ClearErrors(); | 58 void ClearErrors(); |
48 void ShowUserPodCustomIcon(const AccountId& account_id, | 59 void ShowUserPodCustomIcon(const AccountId& account_id, |
49 ash::mojom::UserPodCustomIconOptionsPtr icon); | 60 ash::mojom::UserPodCustomIconOptionsPtr icon); |
50 void HideUserPodCustomIcon(const AccountId& account_id); | 61 void HideUserPodCustomIcon(const AccountId& account_id); |
51 void SetAuthType(const AccountId& account_id, | 62 void SetAuthType(const AccountId& account_id, |
52 ash::mojom::AuthType auth_type, | 63 ash::mojom::AuthType auth_type, |
53 const base::string16& initial_value); | 64 const base::string16& initial_value); |
54 void LoadUsers(std::unique_ptr<base::ListValue> users_list, bool show_guest); | 65 void LoadUsers(std::unique_ptr<base::ListValue> users_list, bool show_guest); |
| 66 void SetPinEnabledForUser(const AccountId& account_id, bool is_enabled); |
55 | 67 |
56 void SetDelegate(Delegate* delegate); | 68 void SetDelegate(Delegate* delegate); |
57 | 69 |
58 private: | 70 private: |
59 // Lock screen mojo service in ash. | 71 // Lock screen mojo service in ash. |
60 ash::mojom::LockScreenPtr lock_screen_; | 72 ash::mojom::LockScreenPtr lock_screen_; |
61 | 73 |
62 // Binds this object to the client interface. | 74 // Binds this object to the client interface. |
63 mojo::Binding<ash::mojom::LockScreenClient> binding_; | 75 mojo::Binding<ash::mojom::LockScreenClient> binding_; |
64 Delegate* delegate_ = nullptr; | 76 Delegate* delegate_ = nullptr; |
65 | 77 |
66 DISALLOW_COPY_AND_ASSIGN(LockScreenClient); | 78 DISALLOW_COPY_AND_ASSIGN(LockScreenClient); |
67 }; | 79 }; |
68 | 80 |
69 #endif // CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_ | 81 #endif // CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_ |
OLD | NEW |