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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" | 36 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" |
37 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h" | 37 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/grit/browser_resources.h" | 39 #include "chrome/grit/browser_resources.h" |
40 #include "chrome/grit/generated_resources.h" | 40 #include "chrome/grit/generated_resources.h" |
41 #include "chromeos/audio/chromeos_sounds.h" | 41 #include "chromeos/audio/chromeos_sounds.h" |
42 #include "chromeos/dbus/dbus_thread_manager.h" | 42 #include "chromeos/dbus/dbus_thread_manager.h" |
43 #include "chromeos/dbus/session_manager_client.h" | 43 #include "chromeos/dbus/session_manager_client.h" |
44 #include "chromeos/login/auth/authenticator.h" | 44 #include "chromeos/login/auth/authenticator.h" |
45 #include "chromeos/login/auth/extended_authenticator.h" | 45 #include "chromeos/login/auth/extended_authenticator.h" |
| 46 #include "chromeos/network/portal_detector/network_portal_detector.h" |
46 #include "components/signin/core/browser/signin_manager.h" | 47 #include "components/signin/core/browser/signin_manager.h" |
47 #include "components/user_manager/user_manager.h" | 48 #include "components/user_manager/user_manager.h" |
48 #include "components/user_manager/user_type.h" | 49 #include "components/user_manager/user_type.h" |
49 #include "content/public/browser/browser_thread.h" | 50 #include "content/public/browser/browser_thread.h" |
50 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
51 #include "content/public/browser/url_data_source.h" | 52 #include "content/public/browser/url_data_source.h" |
52 #include "content/public/browser/user_metrics.h" | 53 #include "content/public/browser/user_metrics.h" |
53 #include "content/public/browser/web_contents.h" | 54 #include "content/public/browser/web_contents.h" |
54 #include "content/public/browser/web_ui.h" | 55 #include "content/public/browser/web_ui.h" |
55 #include "media/audio/sounds/sounds_manager.h" | 56 #include "media/audio/sounds/sounds_manager.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 ash::Shell::GetInstance()->lock_state_controller()->OnStartingLock(); | 360 ash::Shell::GetInstance()->lock_state_controller()->OnStartingLock(); |
360 } else { | 361 } else { |
361 // If the current user's session cannot be locked or the user has not | 362 // If the current user's session cannot be locked or the user has not |
362 // completed all sign-in steps yet, log out instead. The latter is done to | 363 // completed all sign-in steps yet, log out instead. The latter is done to |
363 // avoid complications with displaying the lock screen over the login | 364 // avoid complications with displaying the lock screen over the login |
364 // screen while remaining secure in the case the user walks away during | 365 // screen while remaining secure in the case the user walks away during |
365 // the sign-in steps. See crbug.com/112225 and crbug.com/110933. | 366 // the sign-in steps. See crbug.com/112225 and crbug.com/110933. |
366 VLOG(1) << "Calling session manager's StopSession D-Bus method"; | 367 VLOG(1) << "Calling session manager's StopSession D-Bus method"; |
367 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); | 368 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); |
368 } | 369 } |
| 370 // Close captive portal window and clear signin profile. |
| 371 NetworkPortalDetector::Get()->OnLockScreenRequest(); |
369 } | 372 } |
370 | 373 |
371 // static | 374 // static |
372 void ScreenLocker::Show() { | 375 void ScreenLocker::Show() { |
373 content::RecordAction(UserMetricsAction("ScreenLocker_Show")); | 376 content::RecordAction(UserMetricsAction("ScreenLocker_Show")); |
374 DCHECK(base::MessageLoopForUI::IsCurrent()); | 377 DCHECK(base::MessageLoopForUI::IsCurrent()); |
375 | 378 |
376 // Check whether the currently logged in user is a guest account and if so, | 379 // Check whether the currently logged in user is a guest account and if so, |
377 // refuse to lock the screen (crosbug.com/23764). | 380 // refuse to lock the screen (crosbug.com/23764). |
378 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) { | 381 if (user_manager::UserManager::Get()->IsLoggedInAsGuest()) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 for (user_manager::UserList::const_iterator it = users_.begin(); | 505 for (user_manager::UserList::const_iterator it = users_.begin(); |
503 it != users_.end(); | 506 it != users_.end(); |
504 ++it) { | 507 ++it) { |
505 if ((*it)->email() == username) | 508 if ((*it)->email() == username) |
506 return true; | 509 return true; |
507 } | 510 } |
508 return false; | 511 return false; |
509 } | 512 } |
510 | 513 |
511 } // namespace chromeos | 514 } // namespace chromeos |
OLD | NEW |