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/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" |
(...skipping 10 matching lines...) Expand all Loading... |
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/net/gaia/gaia_auth_util.h" | 28 #include "chrome/common/net/gaia/gaia_auth_util.h" |
29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
30 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
31 #include "chromeos/dbus/power_manager_client.h" | 31 #include "chromeos/dbus/session_manager_client.h" |
32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
34 #include "content/public/browser/notification_types.h" | 34 #include "content/public/browser/notification_types.h" |
35 #include "content/public/browser/user_metrics.h" | 35 #include "content/public/browser/user_metrics.h" |
36 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
37 #include "net/cookies/cookie_monster.h" | 37 #include "net/cookies/cookie_monster.h" |
38 #include "net/cookies/cookie_store.h" | 38 #include "net/cookies/cookie_store.h" |
39 #include "net/url_request/url_request_context.h" | 39 #include "net/url_request/url_request_context.h" |
40 #include "net/url_request/url_request_context_getter.h" | 40 #include "net/url_request/url_request_context_getter.h" |
41 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 DVLOG(1) << "Screen lock requested"; | 379 DVLOG(1) << "Screen lock requested"; |
380 // Will receive notifications on screen unlock and delete itself. | 380 // Will receive notifications on screen unlock and delete itself. |
381 registrar_.Add(this, | 381 registrar_.Add(this, |
382 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 382 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
383 content::NotificationService::AllSources()); | 383 content::NotificationService::AllSources()); |
384 if (ScreenLocker::default_screen_locker()) { | 384 if (ScreenLocker::default_screen_locker()) { |
385 DVLOG(1) << "Screen already locked"; | 385 DVLOG(1) << "Screen already locked"; |
386 ResolveScreenLocked(); | 386 ResolveScreenLocked(); |
387 } else { | 387 } else { |
388 screen_lock_requested_ = true; | 388 screen_lock_requested_ = true; |
389 DBusThreadManager::Get()->GetPowerManagerClient()-> | 389 DBusThreadManager::Get()->GetSessionManagerClient()->RequestLockScreen(); |
390 NotifyScreenLockRequested(); | |
391 } | 390 } |
392 } | 391 } |
393 | 392 |
394 void LoginPerformer::RequestScreenUnlock() { | 393 void LoginPerformer::RequestScreenUnlock() { |
395 DVLOG(1) << "Screen unlock requested"; | 394 DVLOG(1) << "Screen unlock requested"; |
396 if (ScreenLocker::default_screen_locker()) { | 395 if (ScreenLocker::default_screen_locker()) { |
397 DBusThreadManager::Get()->GetPowerManagerClient()-> | 396 DBusThreadManager::Get()->GetSessionManagerClient()->RequestUnlockScreen(); |
398 NotifyScreenUnlockRequested(); | |
399 // Will unsubscribe from notifications once unlock is successful. | 397 // Will unsubscribe from notifications once unlock is successful. |
400 } else { | 398 } else { |
401 LOG(ERROR) << "Screen is not locked"; | 399 LOG(ERROR) << "Screen is not locked"; |
402 NOTREACHED(); | 400 NOTREACHED(); |
403 } | 401 } |
404 } | 402 } |
405 | 403 |
406 void LoginPerformer::ResolveInitialNetworkAuthFailure() { | 404 void LoginPerformer::ResolveInitialNetworkAuthFailure() { |
407 DVLOG(1) << "auth_error: " << last_login_failure_.error().state(); | 405 DVLOG(1) << "auth_error: " << last_login_failure_.error().state(); |
408 | 406 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 profile, | 567 profile, |
570 username_, | 568 username_, |
571 password_, | 569 password_, |
572 std::string(), | 570 std::string(), |
573 std::string())); | 571 std::string())); |
574 } | 572 } |
575 password_.clear(); | 573 password_.clear(); |
576 } | 574 } |
577 | 575 |
578 } // namespace chromeos | 576 } // namespace chromeos |
OLD | NEW |