OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) { | 416 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) { |
417 VLOG(1) << "Refusing to lock screen for guest account"; | 417 VLOG(1) << "Refusing to lock screen for guest account"; |
418 return; | 418 return; |
419 } | 419 } |
420 | 420 |
421 // If the active window is fullscreen, exit fullscreen to avoid the web page | 421 // If the active window is fullscreen, exit fullscreen to avoid the web page |
422 // or app mimicking the lock screen. Do not exit fullscreen if the shelf is | 422 // or app mimicking the lock screen. Do not exit fullscreen if the shelf is |
423 // visible while in fullscreen because the shelf makes it harder for a web | 423 // visible while in fullscreen because the shelf makes it harder for a web |
424 // page or app to mimick the lock screen. | 424 // page or app to mimick the lock screen. |
425 ash::wm::WindowState* active_window_state = ash::wm::GetActiveWindowState(); | 425 ash::wm::WindowState* active_window_state = ash::wm::GetActiveWindowState(); |
426 | 426 if (active_window_state && |
427 if (active_window_state && active_window_state->IsFullscreen() && | 427 active_window_state->IsFullscreen() && |
428 active_window_state->shelf_mode_in_fullscreen() != | 428 active_window_state->hide_shelf_when_fullscreen()) { |
429 ash::wm::WindowState::SHELF_AUTO_HIDE_VISIBLE) { | |
430 const ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); | 429 const ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); |
431 active_window_state->OnWMEvent(&event); | 430 active_window_state->OnWMEvent(&event); |
432 } | 431 } |
433 | 432 |
434 if (!screen_locker_) { | 433 if (!screen_locker_) { |
435 ScreenLocker* locker = | 434 ScreenLocker* locker = |
436 new ScreenLocker(user_manager::UserManager::Get()->GetUnlockUsers()); | 435 new ScreenLocker(user_manager::UserManager::Get()->GetUnlockUsers()); |
437 VLOG(1) << "Created ScreenLocker " << locker; | 436 VLOG(1) << "Created ScreenLocker " << locker; |
438 locker->Init(); | 437 locker->Init(); |
439 } else { | 438 } else { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 539 |
541 bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const { | 540 bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const { |
542 for (user_manager::User* user : users_) { | 541 for (user_manager::User* user : users_) { |
543 if (user->GetAccountId() == account_id) | 542 if (user->GetAccountId() == account_id) |
544 return true; | 543 return true; |
545 } | 544 } |
546 return false; | 545 return false; |
547 } | 546 } |
548 | 547 |
549 } // namespace chromeos | 548 } // namespace chromeos |
OLD | NEW |