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

Unified Diff: chrome/browser/chromeos/login/lock/view_screen_locker.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/chromeos/login/lock/view_screen_locker.h
diff --git a/chrome/browser/chromeos/login/lock/view_screen_locker.h b/chrome/browser/chromeos/login/lock/view_screen_locker.h
new file mode 100644
index 0000000000000000000000000000000000000000..85913ee323e49ac3309bb17406d13d343e6fd002
--- /dev/null
+++ b/chrome/browser/chromeos/login/lock/view_screen_locker.h
@@ -0,0 +1,64 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEW_SCREEN_LOCKER_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEW_SCREEN_LOCKER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/login/lock/screen_locker.h"
+#include "chrome/browser/ui/ash/lock_screen_client.h"
+
+namespace chromeos {
+
+class UserSelectionScreen;
+
+// ViewScreenLocker acts like LockScreenClient::Delegate which handles method
+// calls coming from ash into chrome.
+// It is also a ScreenLocker::Delegate which handles calls from chrome into
+// ash (views-based lockscreen).
+class ViewScreenLocker : public LockScreenClient::Delegate,
xiyuan 2017/05/31 17:51:18 nit: ViewScreenLocker -> ViewsScreenLocker if the
xiaoyinh(OOO Sep 11-29) 2017/06/02 23:42:29 Done.
+ public ScreenLocker::Delegate {
+ public:
+ ViewScreenLocker(ScreenLocker* screen_locker);
xiyuan 2017/05/31 17:51:18 nit: explicit Use "explicit" keyword for single a
xiaoyinh(OOO Sep 11-29) 2017/06/02 23:42:29 Thanks for the information. Done.
+ ~ViewScreenLocker() override;
+
+ // ScreenLocker::Delegate:
+ void SetPasswordInputEnabled(bool enabled) override;
+ void ShowErrorMessage(int error_msg_id,
+ HelpAppLauncher::HelpTopic help_topic_id) override;
+ void ClearErrors() override;
+ void AnimateAuthenticationSuccess() override;
+ void OnLockWebUIReady() override;
+ void OnLockBackgroundDisplayed() override;
+ void OnHeaderBarVisible() override;
+ void OnAshLockAnimationFinished() override;
+ void SetFingerprintState(const AccountId& account_id,
+ ScreenLocker::FingerprintState state) override;
+ content::WebContents* GetWebContents() override;
+
+ void Init();
+ void OnLockScreenReady();
+
+ private:
+ // LockScreenClient::Delegate
+ void HandleAttemptUnlock(const AccountId& account_id) override;
+ void HandleHardlockPod(const AccountId& account_id) override;
+ void HandleRecordClickOnLockIcon(const AccountId& account_id) override;
+
+ std::unique_ptr<UserSelectionScreen> user_selection_screen_;
+
+ // The ScreenLocker that owns this instance.
+ ScreenLocker* screen_locker_ = nullptr;
xiyuan 2017/05/31 17:51:18 nit: ScreenLocker* const screen_locker_; since |s
xiaoyinh(OOO Sep 11-29) 2017/06/02 23:42:29 Done.
+
+ // Time when lock was initiated, required for metrics.
+ base::TimeTicks lock_time_;
+
+ base::WeakPtrFactory<ViewScreenLocker> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewScreenLocker);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_VIEW_SCREEN_LOCKER_H_

Powered by Google App Engine
This is Rietveld 408576698