| 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/login_performer.h" | 5 #include "chrome/browser/chromeos/login/login_performer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/chromeos/boot_times_loader.h" | 16 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 18 #include "chrome/browser/chromeos/cros/screen_lock_library.h" |
| 17 #include "chrome/browser/chromeos/cros_settings.h" | 19 #include "chrome/browser/chromeos/cros_settings.h" |
| 18 #include "chrome/browser/chromeos/cros_settings_names.h" | 20 #include "chrome/browser/chromeos/cros_settings_names.h" |
| 19 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | |
| 20 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | |
| 21 #include "chrome/browser/chromeos/login/login_utils.h" | 21 #include "chrome/browser/chromeos/login/login_utils.h" |
| 22 #include "chrome/browser/chromeos/login/screen_locker.h" | 22 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| 26 #include "chrome/common/chrome_notification_types.h" | 26 #include "chrome/common/chrome_notification_types.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "content/browser/user_metrics.h" | 29 #include "content/browser/user_metrics.h" |
| 30 #include "content/public/browser/browser_thread.h" | 30 #include "content/public/browser/browser_thread.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 DVLOG(1) << "Screen lock requested"; | 360 DVLOG(1) << "Screen lock requested"; |
| 361 // Will receive notifications on screen unlock and delete itself. | 361 // Will receive notifications on screen unlock and delete itself. |
| 362 registrar_.Add(this, | 362 registrar_.Add(this, |
| 363 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 363 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 364 content::NotificationService::AllSources()); | 364 content::NotificationService::AllSources()); |
| 365 if (ScreenLocker::default_screen_locker()) { | 365 if (ScreenLocker::default_screen_locker()) { |
| 366 DVLOG(1) << "Screen already locked"; | 366 DVLOG(1) << "Screen already locked"; |
| 367 ResolveScreenLocked(); | 367 ResolveScreenLocked(); |
| 368 } else { | 368 } else { |
| 369 screen_lock_requested_ = true; | 369 screen_lock_requested_ = true; |
| 370 DBusThreadManager::Get()->GetPowerManagerClient()-> | 370 chromeos::CrosLibrary::Get()->GetScreenLockLibrary()-> |
| 371 NotifyScreenLockRequested(); | 371 NotifyScreenLockRequested(); |
| 372 } | 372 } |
| 373 } | 373 } |
| 374 | 374 |
| 375 void LoginPerformer::RequestScreenUnlock() { | 375 void LoginPerformer::RequestScreenUnlock() { |
| 376 DVLOG(1) << "Screen unlock requested"; | 376 DVLOG(1) << "Screen unlock requested"; |
| 377 if (ScreenLocker::default_screen_locker()) { | 377 if (ScreenLocker::default_screen_locker()) { |
| 378 DBusThreadManager::Get()->GetPowerManagerClient()-> | 378 chromeos::CrosLibrary::Get()->GetScreenLockLibrary()-> |
| 379 NotifyScreenUnlockRequested(); | 379 NotifyScreenUnlockRequested(); |
| 380 // Will unsubscribe from notifications once unlock is successful. | 380 // Will unsubscribe from notifications once unlock is successful. |
| 381 } else { | 381 } else { |
| 382 LOG(ERROR) << "Screen is not locked"; | 382 LOG(ERROR) << "Screen is not locked"; |
| 383 NOTREACHED(); | 383 NOTREACHED(); |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 | 386 |
| 387 void LoginPerformer::ResolveInitialNetworkAuthFailure() { | 387 void LoginPerformer::ResolveInitialNetworkAuthFailure() { |
| 388 DVLOG(1) << "auth_error: " << last_login_failure_.error().state(); | 388 DVLOG(1) << "auth_error: " << last_login_failure_.error().state(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 profile, | 545 profile, |
| 546 username_, | 546 username_, |
| 547 password_, | 547 password_, |
| 548 captcha_token_, | 548 captcha_token_, |
| 549 captcha_)); | 549 captcha_)); |
| 550 } | 550 } |
| 551 password_.clear(); | 551 password_.clear(); |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace chromeos | 554 } // namespace chromeos |
| OLD | NEW |