Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/ui/ash/lock_screen_client.h

Issue 2903353003: Adding mojo calls for easy unlock service (Closed)
Patch Set: incoporate comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/memory/weak_ptr.h"
11 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h"
10 #include "mojo/public/cpp/bindings/binding.h" 12 #include "mojo/public/cpp/bindings/binding.h"
11 13
12 // Handles method calls delegated back to chrome from ash. Also notifies ash of 14 // Handles method calls delegated back to chrome from ash. Also notifies ash of
13 // relevant state changes in chrome. 15 // relevant state changes in chrome.
14 class LockScreenClient : public ash::mojom::LockScreenClient { 16 class LockScreenClient : public ash::mojom::LockScreenClient,
17 public chromeos::UserBoardView {
xiyuan 2017/05/31 17:51:19 Can we have a separate UserBoardView impl/proxy in
xiaoyinh(OOO Sep 11-29) 2017/06/02 23:42:29 Thanks! I added UserSelectionScreenProxy as a sepa
15 public: 18 public:
16 LockScreenClient(); 19 LockScreenClient();
17 ~LockScreenClient() override; 20 ~LockScreenClient() override;
18 21
22 // Handles method calls coming from ash into chrome.
23 class Delegate {
24 public:
25 Delegate();
26 virtual ~Delegate();
27 virtual void HandleAttemptUnlock(const AccountId& account_id) = 0;
28 virtual void HandleHardlockPod(const AccountId& account_id) = 0;
29 virtual void HandleRecordClickOnLockIcon(const AccountId& account_id) = 0;
30
31 private:
32 DISALLOW_COPY_AND_ASSIGN(Delegate);
33 };
34
19 static LockScreenClient* Get(); 35 static LockScreenClient* Get();
20 36
21 // ash::mojom::LockScreenClient: 37 // ash::mojom::LockScreenClient:
22 void AuthenticateUser(const AccountId& account_id, 38 void AuthenticateUser(const AccountId& account_id,
23 const std::string& hashed_password, 39 const std::string& hashed_password,
24 bool authenticated_by_pin) override; 40 bool authenticated_by_pin) override;
41 void AttemptUnlock(const AccountId& account_id) override;
42 void HardlockPod(const AccountId& account_id) override;
43 void RecordClickOnLockIcon(const AccountId& account_id) override;
44
45 // UserBoardView:
46 void SetPublicSessionDisplayName(const AccountId& account_id,
47 const std::string& display_name) override{};
48 void SetPublicSessionLocales(const AccountId& account_id,
49 std::unique_ptr<base::ListValue> locales,
50 const std::string& default_locale,
51 bool multiple_recommended_locales) override{};
52 void ShowBannerMessage(const base::string16& message) override{};
53 void ShowUserPodCustomIcon(const AccountId& account_id,
54 const base::DictionaryValue& icon) override;
55 void HideUserPodCustomIcon(const AccountId& account_id) override;
56 void SetAuthType(
57 const AccountId& account_id,
58 proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type,
59 const base::string16& initial_value) override;
60 void Bind(chromeos::UserSelectionScreen* screen) override{};
61 void Unbind() override{};
62 base::WeakPtr<UserBoardView> GetWeakPtr() override;
25 63
26 // Wrappers around the mojom::SystemTray interface. 64 // Wrappers around the mojom::SystemTray interface.
xiyuan 2017/05/31 17:51:19 nit: This comment looks wrong.
xiaoyinh(OOO Sep 11-29) 2017/06/02 23:42:29 Thanks! Changed.
27 void ShowErrorMessage(int32_t login_attempts, 65 void ShowErrorMessage(int32_t login_attempts,
28 const std::string& error_text, 66 const std::string& error_text,
29 const std::string& help_link_text, 67 const std::string& help_link_text,
30 int32_t help_topic_id); 68 int32_t help_topic_id);
31 void ClearErrors(); 69 void ClearErrors();
70 void LoadUsers(const base::ListValue& users_list, bool show_guest);
71 void SetDelegate(Delegate* delegate);
32 72
33 private: 73 private:
34 // Lock screen mojo service in ash. 74 // Lock screen mojo service in ash.
35 ash::mojom::LockScreenPtr lock_screen_; 75 ash::mojom::LockScreenPtr lock_screen_;
36 76
37 // Binds this object to the client interface. 77 // Binds this object to the client interface.
38 mojo::Binding<ash::mojom::LockScreenClient> binding_; 78 mojo::Binding<ash::mojom::LockScreenClient> binding_;
79 Delegate* delegate_ = nullptr;
39 80
40 DISALLOW_COPY_AND_ASSIGN(LockScreenClient); 81 DISALLOW_COPY_AND_ASSIGN(LockScreenClient);
41 }; 82 };
42 83
43 #endif // CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_ 84 #endif // CHROME_BROWSER_UI_ASH_LOCK_SCREEN_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698