OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/timer.h" | 17 #include "base/timer.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/chromeos/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
20 #include "chrome/browser/chromeos/cros/login_library.h" | |
21 #include "chrome/browser/chromeos/cros/screen_lock_library.h" | 20 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 21 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 22 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
22 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 23 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
23 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 24 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
24 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 25 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
25 #include "chrome/browser/chromeos/language_preferences.h" | 26 #include "chrome/browser/chromeos/language_preferences.h" |
26 #include "chrome/browser/chromeos/login/authenticator.h" | 27 #include "chrome/browser/chromeos/login/authenticator.h" |
27 #include "chrome/browser/chromeos/login/login_performer.h" | 28 #include "chrome/browser/chromeos/login/login_performer.h" |
28 #include "chrome/browser/chromeos/login/login_utils.h" | 29 #include "chrome/browser/chromeos/login/login_utils.h" |
29 #include "chrome/browser/chromeos/login/screen_locker_views.h" | 30 #include "chrome/browser/chromeos/login/screen_locker_views.h" |
30 #include "chrome/browser/chromeos/login/screen_locker_webui.h" | 31 #include "chrome/browser/chromeos/login/screen_locker_webui.h" |
31 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 delegate_->SetInputEnabled(true); | 311 delegate_->SetInputEnabled(true); |
311 } | 312 } |
312 | 313 |
313 void ScreenLocker::Signout() { | 314 void ScreenLocker::Signout() { |
314 // TODO(flackr): For proper functionality, check if (error_info) is NULL. | 315 // TODO(flackr): For proper functionality, check if (error_info) is NULL. |
315 delegate_->ClearErrors(); | 316 delegate_->ClearErrors(); |
316 UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Signout")); | 317 UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Signout")); |
317 #if defined(TOOLKIT_USES_GTK) | 318 #if defined(TOOLKIT_USES_GTK) |
318 WmIpc::instance()->NotifyAboutSignout(); | 319 WmIpc::instance()->NotifyAboutSignout(); |
319 #endif | 320 #endif |
320 if (CrosLibrary::Get()->EnsureLoaded()) | 321 DBusThreadManager::Get()->session_manager_client()->StopSession(); |
321 CrosLibrary::Get()->GetLoginLibrary()->StopSession(""); | |
322 | 322 |
323 // Don't hide yet the locker because the chrome screen may become visible | 323 // Don't hide yet the locker because the chrome screen may become visible |
324 // briefly. | 324 // briefly. |
325 } | 325 } |
326 | 326 |
327 void ScreenLocker::ShowErrorMessage(const string16& message, | 327 void ScreenLocker::ShowErrorMessage(const string16& message, |
328 bool sign_out_only) { | 328 bool sign_out_only) { |
329 delegate_->SetInputEnabled(!sign_out_only); | 329 delegate_->SetInputEnabled(!sign_out_only); |
330 delegate_->SetSignoutEnabled(sign_out_only); | 330 delegate_->SetSignoutEnabled(sign_out_only); |
331 delegate_->ShowErrorMessage(message, sign_out_only); | 331 delegate_->ShowErrorMessage(message, sign_out_only); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 bool state = true; | 443 bool state = true; |
444 NotificationService::current()->Notify( | 444 NotificationService::current()->Notify( |
445 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 445 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
446 Source<ScreenLocker>(this), | 446 Source<ScreenLocker>(this), |
447 Details<bool>(&state)); | 447 Details<bool>(&state)); |
448 if (CrosLibrary::Get()->EnsureLoaded()) | 448 if (CrosLibrary::Get()->EnsureLoaded()) |
449 CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenLockCompleted(); | 449 CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenLockCompleted(); |
450 } | 450 } |
451 | 451 |
452 } // namespace chromeos | 452 } // namespace chromeos |
OLD | NEW |