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

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

Issue 620663005: Lock screen for Chrome-Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more nit Created 6 years, 2 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 | « athena/system/DEPS ('k') | chrome/browser/chromeos/login/lock/webui_screen_locker.cc » ('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 d2b05515ea61acd7f0f6599335fa6059a817e367..ec623c65621e3bcb76a3e7aaf32ada9c5df15f6b 100644
--- a/chrome/browser/chromeos/login/lock/screen_locker.cc
+++ b/chrome/browser/chromeos/login/lock/screen_locker.cc
@@ -364,7 +364,10 @@ void ScreenLocker::HandleLockScreenRequest() {
if (g_screen_lock_observer->session_started() &&
user_manager::UserManager::Get()->CanCurrentUserLock()) {
ScreenLocker::Show();
+#if !defined(USE_ATHENA)
+ // TOOD(dpolukhin): crbug.com/413926.
ash::Shell::GetInstance()->lock_state_controller()->OnStartingLock();
+#endif
} else {
// If the current user's session cannot be locked or the user has not
// completed all sign-in steps yet, log out instead. The latter is done to
@@ -378,11 +381,6 @@ void ScreenLocker::HandleLockScreenRequest() {
// static
void ScreenLocker::Show() {
-#if defined(USE_ATHENA)
- // crbug.com/413926
- return;
-#endif
-
content::RecordAction(UserMetricsAction("ScreenLocker_Show"));
DCHECK(base::MessageLoopForUI::IsCurrent());
@@ -395,6 +393,7 @@ void ScreenLocker::Show() {
return;
}
+#if !defined(USE_ATHENA)
// If the active window is fullscreen, exit fullscreen to avoid the web page
// or app mimicking the lock screen. Do not exit fullscreen if the shelf is
// visible while in fullscreen because the shelf makes it harder for a web
@@ -406,6 +405,7 @@ void ScreenLocker::Show() {
const ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN);
active_window_state->OnWMEvent(&event);
}
+#endif
if (!screen_locker_) {
ScreenLocker* locker =
@@ -422,11 +422,6 @@ void ScreenLocker::Show() {
// static
void ScreenLocker::Hide() {
-#if defined(USE_ATHENA)
- // crbug.com/413926
- return;
-#endif
-
DCHECK(base::MessageLoopForUI::IsCurrent());
// For a guest/demo user, screen_locker_ would have never been initialized.
if (user_manager::UserManager::Get()->IsLoggedInAsGuest() ||
@@ -438,8 +433,12 @@ void ScreenLocker::Hide() {
DCHECK(screen_locker_);
base::Callback<void(void)> callback =
base::Bind(&ScreenLocker::ScheduleDeletion);
+#if !defined(USE_ATHENA)
ash::Shell::GetInstance()->lock_state_controller()->
OnLockScreenHide(callback);
+#else
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback);
+#endif
}
void ScreenLocker::ScheduleDeletion() {
@@ -448,7 +447,9 @@ void ScreenLocker::ScheduleDeletion() {
return;
VLOG(1) << "Deleting ScreenLocker " << screen_locker_;
+#if !defined(USE_ATHENA)
ash::PlaySystemSoundIfSpokenFeedback(SOUND_UNLOCK);
+#endif
delete screen_locker_;
screen_locker_ = NULL;
@@ -465,9 +466,12 @@ ScreenLocker::~ScreenLocker() {
authenticator_->SetConsumer(NULL);
ClearErrors();
+#if !defined(USE_ATHENA)
+ // TOOD(dpolukhin): we need to to something similar for Athena.
VLOG(1) << "Moving desktop background to unlocked container";
ash::Shell::GetInstance()->
desktop_background_controller()->MoveDesktopToUnlockedContainer();
+#endif
screen_locker_ = NULL;
bool state = false;
@@ -498,8 +502,10 @@ void ScreenLocker::ScreenLockReady() {
UMA_HISTOGRAM_TIMES("ScreenLocker.ScreenLockTime", delta);
VLOG(1) << "Moving desktop background to locked container";
+#if !defined(USE_ATHENA)
ash::Shell::GetInstance()->
desktop_background_controller()->MoveDesktopToLockedContainer();
+#endif
input_method::InputMethodManager::Get()
->GetActiveIMEState()
« no previous file with comments | « athena/system/DEPS ('k') | chrome/browser/chromeos/login/lock/webui_screen_locker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698