OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/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" |
11 #include "ash/desktop_background/desktop_background_controller.h" | 11 #include "ash/desktop_background/desktop_background_controller.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/wm/session_state_controller.h" | 13 #include "ash/wm/session_state_controller.h" |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/message_loop.h" | 18 #include "base/message_loop.h" |
19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/timer.h" | 21 #include "base/timer.h" |
22 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
23 #include "chrome/browser/chromeos/login/authenticator.h" | 23 #include "chrome/browser/chromeos/login/authenticator.h" |
24 #include "chrome/browser/chromeos/login/login_performer.h" | 24 #include "chrome/browser/chromeos/login/login_performer.h" |
25 #include "chrome/browser/chromeos/login/login_utils.h" | 25 #include "chrome/browser/chromeos/login/login_utils.h" |
26 #include "chrome/browser/chromeos/login/user_manager.h" | 26 #include "chrome/browser/chromeos/login/user_manager.h" |
27 #include "chrome/browser/chromeos/login/webui_screen_locker.h" | 27 #include "chrome/browser/chromeos/login/webui_screen_locker.h" |
28 #include "chrome/browser/lifetime/application_lifetime.h" | |
28 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
29 #include "chrome/browser/profiles/profile_manager.h" | 30 #include "chrome/browser/profiles/profile_manager.h" |
30 #include "chrome/browser/signin/signin_manager.h" | 31 #include "chrome/browser/signin/signin_manager.h" |
31 #include "chrome/browser/signin/signin_manager_factory.h" | 32 #include "chrome/browser/signin/signin_manager_factory.h" |
32 #include "chrome/browser/sync/profile_sync_service.h" | 33 #include "chrome/browser/sync/profile_sync_service.h" |
33 #include "chrome/browser/sync/profile_sync_service_factory.h" | 34 #include "chrome/browser/sync/profile_sync_service_factory.h" |
34 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" |
35 #include "chrome/browser/ui/browser_commands.h" | 36 #include "chrome/browser/ui/browser_commands.h" |
36 #include "chrome/browser/ui/browser_finder.h" | 37 #include "chrome/browser/ui/browser_finder.h" |
37 #include "chrome/browser/ui/browser_window.h" | 38 #include "chrome/browser/ui/browser_window.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 } | 279 } |
279 | 280 |
280 void ScreenLocker::ClearErrors() { | 281 void ScreenLocker::ClearErrors() { |
281 delegate_->ClearErrors(); | 282 delegate_->ClearErrors(); |
282 } | 283 } |
283 | 284 |
284 void ScreenLocker::EnableInput() { | 285 void ScreenLocker::EnableInput() { |
285 delegate_->SetInputEnabled(true); | 286 delegate_->SetInputEnabled(true); |
286 } | 287 } |
287 | 288 |
288 void ScreenLocker::Signout() { | 289 void ScreenLocker::Signout() { |
Nikita (slow)
2013/04/08 17:05:53
It seem that there're autotests that employ this f
| |
289 delegate_->ClearErrors(); | 290 delegate_->ClearErrors(); |
290 content::RecordAction(UserMetricsAction("ScreenLocker_Signout")); | 291 content::RecordAction(UserMetricsAction("ScreenLocker_Signout")); |
291 DBusThreadManager::Get()->GetSessionManagerClient()->StopSession(); | 292 // We expect that this call will not wait for any user input. |
293 // If it changes at some point, we will need to force exit. | |
294 chrome::AttemptUserExit(); | |
292 | 295 |
293 // Don't hide yet the locker because the chrome screen may become visible | 296 // Don't hide yet the locker because the chrome screen may become visible |
294 // briefly. | 297 // briefly. |
295 } | 298 } |
296 | 299 |
297 void ScreenLocker::ShowErrorMessage(int error_msg_id, | 300 void ScreenLocker::ShowErrorMessage(int error_msg_id, |
298 HelpAppLauncher::HelpTopic help_topic_id, | 301 HelpAppLauncher::HelpTopic help_topic_id, |
299 bool sign_out_only) { | 302 bool sign_out_only) { |
300 delegate_->SetInputEnabled(!sign_out_only); | 303 delegate_->SetInputEnabled(!sign_out_only); |
301 delegate_->ShowErrorMessage(error_msg_id, help_topic_id); | 304 delegate_->ShowErrorMessage(error_msg_id, help_topic_id); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 content::Details<bool>(&state)); | 429 content::Details<bool>(&state)); |
427 VLOG(1) << "Calling session manager's HandleLockScreenShown D-Bus method"; | 430 VLOG(1) << "Calling session manager's HandleLockScreenShown D-Bus method"; |
428 DBusThreadManager::Get()->GetSessionManagerClient()->NotifyLockScreenShown(); | 431 DBusThreadManager::Get()->GetSessionManagerClient()->NotifyLockScreenShown(); |
429 } | 432 } |
430 | 433 |
431 content::WebUI* ScreenLocker::GetAssociatedWebUI() { | 434 content::WebUI* ScreenLocker::GetAssociatedWebUI() { |
432 return delegate_->GetAssociatedWebUI(); | 435 return delegate_->GetAssociatedWebUI(); |
433 } | 436 } |
434 | 437 |
435 } // namespace chromeos | 438 } // namespace chromeos |
OLD | NEW |