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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 content::NotificationService::AllSources()); | 65 content::NotificationService::AllSources()); |
66 } | 66 } |
67 | 67 |
68 // NotificationObserver overrides: | 68 // NotificationObserver overrides: |
69 virtual void Observe(int type, | 69 virtual void Observe(int type, |
70 const content::NotificationSource& source, | 70 const content::NotificationSource& source, |
71 const content::NotificationDetails& details) OVERRIDE { | 71 const content::NotificationDetails& details) OVERRIDE { |
72 switch (type) { | 72 switch (type) { |
73 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { | 73 case chrome::NOTIFICATION_LOGIN_USER_CHANGED: { |
74 // Register Screen Lock only after a user has logged in. | 74 // Register Screen Lock only after a user has logged in. |
75 // TODO(flackr): Observe PowerManagerClient on desktop build. | |
76 // crbug.com/119798 | |
77 chromeos::PowerManagerClient* power_manager = | 75 chromeos::PowerManagerClient* power_manager = |
78 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(); | 76 chromeos::DBusThreadManager::Get()->GetPowerManagerClient(); |
79 if (!power_manager->HasObserver(this)) | 77 if (!power_manager->HasObserver(this)) |
80 power_manager->AddObserver(this); | 78 power_manager->AddObserver(this); |
81 break; | 79 break; |
82 } | 80 } |
83 | 81 |
84 case chrome::NOTIFICATION_SESSION_STARTED: { | 82 case chrome::NOTIFICATION_SESSION_STARTED: { |
85 session_started_ = true; | 83 session_started_ = true; |
86 break; | 84 break; |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 bool state = true; | 452 bool state = true; |
455 content::NotificationService::current()->Notify( | 453 content::NotificationService::current()->Notify( |
456 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 454 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
457 content::Source<ScreenLocker>(this), | 455 content::Source<ScreenLocker>(this), |
458 content::Details<bool>(&state)); | 456 content::Details<bool>(&state)); |
459 DBusThreadManager::Get()->GetPowerManagerClient()-> | 457 DBusThreadManager::Get()->GetPowerManagerClient()-> |
460 NotifyScreenLockCompleted(); | 458 NotifyScreenLockCompleted(); |
461 } | 459 } |
462 | 460 |
463 } // namespace chromeos | 461 } // namespace chromeos |
OLD | NEW |