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 if (active_window_state && | 426 if (active_window_state && active_window_state->IsFullscreen() && |
427 active_window_state->IsFullscreen() && | 427 active_window_state->shelf_mode_in_fullscreen() == |
428 active_window_state->hide_shelf_when_fullscreen()) { | 428 ash::wm::WindowState::SHELF_HIDDEN) { |
429 const ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); | 429 const ash::wm::WMEvent event(ash::wm::WM_EVENT_TOGGLE_FULLSCREEN); |
430 active_window_state->OnWMEvent(&event); | 430 active_window_state->OnWMEvent(&event); |
431 } | 431 } |
432 | 432 |
433 if (!screen_locker_) { | 433 if (!screen_locker_) { |
434 ScreenLocker* locker = | 434 ScreenLocker* locker = |
435 new ScreenLocker(user_manager::UserManager::Get()->GetUnlockUsers()); | 435 new ScreenLocker(user_manager::UserManager::Get()->GetUnlockUsers()); |
436 VLOG(1) << "Created ScreenLocker " << locker; | 436 VLOG(1) << "Created ScreenLocker " << locker; |
437 locker->Init(); | 437 locker->Init(); |
438 } else { | 438 } else { |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const { | 540 bool ScreenLocker::IsUserLoggedIn(const AccountId& account_id) const { |
541 for (user_manager::User* user : users_) { | 541 for (user_manager::User* user : users_) { |
542 if (user->GetAccountId() == account_id) | 542 if (user->GetAccountId() == account_id) |
543 return true; | 543 return true; |
544 } | 544 } |
545 return false; | 545 return false; |
546 } | 546 } |
547 | 547 |
548 } // namespace chromeos | 548 } // namespace chromeos |
OLD | NEW |