| 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" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 43 #include "googleurl/src/gurl.h" | 43 #include "googleurl/src/gurl.h" |
| 44 #include "grit/generated_resources.h" | 44 #include "grit/generated_resources.h" |
| 45 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" | 45 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
| 46 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
| 47 | 47 |
| 48 #if defined(TOOLKIT_USES_GTK) | 48 #if defined(TOOLKIT_USES_GTK) |
| 49 #include "chrome/browser/chromeos/wm_ipc.h" | 49 #include "chrome/browser/chromeos/wm_ipc.h" |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 using content::BrowserThread; |
| 53 |
| 52 namespace { | 54 namespace { |
| 53 | 55 |
| 54 // Observer to start ScreenLocker when the screen lock | 56 // Observer to start ScreenLocker when the screen lock |
| 55 class ScreenLockObserver : public chromeos::ScreenLockLibrary::Observer, | 57 class ScreenLockObserver : public chromeos::ScreenLockLibrary::Observer, |
| 56 public content::NotificationObserver { | 58 public content::NotificationObserver { |
| 57 public: | 59 public: |
| 58 ScreenLockObserver() { | 60 ScreenLockObserver() { |
| 59 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 61 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 60 content::NotificationService::AllSources()); | 62 content::NotificationService::AllSources()); |
| 61 } | 63 } |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 bool state = true; | 445 bool state = true; |
| 444 content::NotificationService::current()->Notify( | 446 content::NotificationService::current()->Notify( |
| 445 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 447 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 446 content::Source<ScreenLocker>(this), | 448 content::Source<ScreenLocker>(this), |
| 447 content::Details<bool>(&state)); | 449 content::Details<bool>(&state)); |
| 448 if (CrosLibrary::Get()->EnsureLoaded()) | 450 if (CrosLibrary::Get()->EnsureLoaded()) |
| 449 CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenLockCompleted(); | 451 CrosLibrary::Get()->GetScreenLockLibrary()->NotifyScreenLockCompleted(); |
| 450 } | 452 } |
| 451 | 453 |
| 452 } // namespace chromeos | 454 } // namespace chromeos |
| OLD | NEW |