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

Unified Diff: chrome/browser/chromeos/login/lock/screen_locker.cc

Issue 2876673002: mojo api for view based lockscreen (Closed)
Patch Set: Incorporate comments from patch set 8 and rebase 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
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/lock/screen_locker.cc
diff --git a/chrome/browser/chromeos/login/lock/screen_locker.cc b/chrome/browser/chromeos/login/lock/screen_locker.cc
index e0b05e96e74706aa3dc4f823345f830c464ae105..5e461944a92322ddaf7cc6e50f20c8037747a14c 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -42,6 +42,7 @@
#include "chrome/browser/signin/easy_unlock_service.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/ash/ash_util.h"
+#include "chrome/browser/ui/ash/lock_screen_client.h"
#include "chrome/browser/ui/ash/session_controller_client.h"
#include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h"
#include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h"
@@ -165,19 +166,22 @@ class ScreenLockObserver : public SessionManagerClient::StubDelegate,
DISALLOW_COPY_AND_ASSIGN(ScreenLockObserver);
};
-// Stubbed delegate that will eventually be replaced by mojo calls.
-class StubDelegate : public ScreenLocker::Delegate {
+// Mojo delegate that calls into the views-based lock screen via mojo.
+class MojoDelegate : public ScreenLocker::Delegate {
public:
- StubDelegate() = default;
- ~StubDelegate() override = default;
+ MojoDelegate() = default;
+ ~MojoDelegate() override = default;
// ScreenLocker::Delegate:
void SetPasswordInputEnabled(bool enabled) override { NOTIMPLEMENTED(); }
void ShowErrorMessage(int error_msg_id,
HelpAppLauncher::HelpTopic help_topic_id) override {
- NOTIMPLEMENTED();
+ // TODO(xiaoyinh): Complete the implementation here.
+ LockScreenClient::Get()->ShowErrorMessage(0 /* login_attempts */,
+ std::string(), std::string(),
+ static_cast<int>(help_topic_id));
}
- void ClearErrors() override { NOTIMPLEMENTED(); }
+ void ClearErrors() override { LockScreenClient::Get()->ClearErrors(); }
void AnimateAuthenticationSuccess() override { NOTIMPLEMENTED(); }
void OnLockWebUIReady() override { NOTIMPLEMENTED(); }
void OnLockBackgroundDisplayed() override { NOTIMPLEMENTED(); }
@@ -190,7 +194,7 @@ class StubDelegate : public ScreenLocker::Delegate {
content::WebContents* GetWebContents() override { return nullptr; }
private:
- DISALLOW_COPY_AND_ASSIGN(StubDelegate);
+ DISALLOW_COPY_AND_ASSIGN(MojoDelegate);
};
ScreenLockObserver* g_screen_lock_observer = nullptr;
@@ -236,9 +240,8 @@ void ScreenLocker::Init() {
authenticator_ = UserSessionManager::GetInstance()->CreateAuthenticator(this);
extended_authenticator_ = ExtendedAuthenticator::Create(this);
if (IsUsingMdLogin()) {
- // Create delegate that will eventually call into the views-based lock
- // screen via mojo.
- delegate_ = new StubDelegate();
+ // Create delegate that calls into the views-based lock screen via mojo.
+ delegate_ = new MojoDelegate();
owns_delegate_ = true;
// Create and display lock screen.
« no previous file with comments | « ash/test/ash_test_helper.cc ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698