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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/lock_screen_client.h
diff --git a/chrome/browser/ui/ash/lock_screen_client.h b/chrome/browser/ui/ash/lock_screen_client.h
index 7e0d13434645794800f2e30328182bb5d3c1a232..cd2063bba505dd0023f839485fb76f8ad1b7c674 100644
--- a/chrome/browser/ui/ash/lock_screen_client.h
+++ b/chrome/browser/ui/ash/lock_screen_client.h
@@ -7,21 +7,59 @@
#include "ash/public/interfaces/lock_screen.mojom.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/login/ui/views/user_board_view.h"
#include "mojo/public/cpp/bindings/binding.h"
// Handles method calls delegated back to chrome from ash. Also notifies ash of
// relevant state changes in chrome.
-class LockScreenClient : public ash::mojom::LockScreenClient {
+class LockScreenClient : public ash::mojom::LockScreenClient,
+ 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
public:
LockScreenClient();
~LockScreenClient() override;
+ // Handles method calls coming from ash into chrome.
+ class Delegate {
+ public:
+ Delegate();
+ virtual ~Delegate();
+ virtual void HandleAttemptUnlock(const AccountId& account_id) = 0;
+ virtual void HandleHardlockPod(const AccountId& account_id) = 0;
+ virtual void HandleRecordClickOnLockIcon(const AccountId& account_id) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
static LockScreenClient* Get();
// ash::mojom::LockScreenClient:
void AuthenticateUser(const AccountId& account_id,
const std::string& hashed_password,
bool authenticated_by_pin) override;
+ void AttemptUnlock(const AccountId& account_id) override;
+ void HardlockPod(const AccountId& account_id) override;
+ void RecordClickOnLockIcon(const AccountId& account_id) override;
+
+ // UserBoardView:
+ void SetPublicSessionDisplayName(const AccountId& account_id,
+ const std::string& display_name) override{};
+ void SetPublicSessionLocales(const AccountId& account_id,
+ std::unique_ptr<base::ListValue> locales,
+ const std::string& default_locale,
+ bool multiple_recommended_locales) override{};
+ void ShowBannerMessage(const base::string16& message) override{};
+ void ShowUserPodCustomIcon(const AccountId& account_id,
+ const base::DictionaryValue& icon) override;
+ void HideUserPodCustomIcon(const AccountId& account_id) override;
+ void SetAuthType(
+ const AccountId& account_id,
+ proximity_auth::ScreenlockBridge::LockHandler::AuthType auth_type,
+ const base::string16& initial_value) override;
+ void Bind(chromeos::UserSelectionScreen* screen) override{};
+ void Unbind() override{};
+ base::WeakPtr<UserBoardView> GetWeakPtr() override;
// 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.
void ShowErrorMessage(int32_t login_attempts,
@@ -29,6 +67,8 @@ class LockScreenClient : public ash::mojom::LockScreenClient {
const std::string& help_link_text,
int32_t help_topic_id);
void ClearErrors();
+ void LoadUsers(const base::ListValue& users_list, bool show_guest);
+ void SetDelegate(Delegate* delegate);
private:
// Lock screen mojo service in ash.
@@ -36,6 +76,7 @@ class LockScreenClient : public ash::mojom::LockScreenClient {
// Binds this object to the client interface.
mojo::Binding<ash::mojom::LockScreenClient> binding_;
+ Delegate* delegate_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(LockScreenClient);
};

Powered by Google App Engine
This is Rietveld 408576698