| 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/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/automation/automation_provider.h" | 8 #include "chrome/browser/automation/automation_provider.h" |
| 9 #include "chrome/browser/chromeos/cros/cros_library.h" | 9 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 10 #include "chrome/browser/chromeos/login/authentication_notification_details.h" | 10 #include "chrome/browser/chromeos/login/authentication_notification_details.h" |
| 11 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen_
actor.h" | 11 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen_
actor.h" |
| 12 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 12 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 13 #include "chrome/browser/chromeos/login/screen_locker.h" | 13 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 14 #include "chrome/browser/chromeos/login/user_manager.h" | 14 #include "chrome/browser/chromeos/login/user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/wizard_controller.h" | 15 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 16 #include "chrome/common/chrome_notification_types.h" | 16 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "content/common/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 | 18 |
| 19 using chromeos::CrosLibrary; | 19 using chromeos::CrosLibrary; |
| 20 using chromeos::NetworkLibrary; | 20 using chromeos::NetworkLibrary; |
| 21 | 21 |
| 22 NetworkManagerInitObserver::NetworkManagerInitObserver( | 22 NetworkManagerInitObserver::NetworkManagerInitObserver( |
| 23 AutomationProvider* automation) | 23 AutomationProvider* automation) |
| 24 : automation_(automation->AsWeakPtr()) {} | 24 : automation_(automation->AsWeakPtr()) {} |
| 25 | 25 |
| 26 NetworkManagerInitObserver::~NetworkManagerInitObserver() { | 26 NetworkManagerInitObserver::~NetworkManagerInitObserver() { |
| 27 CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this); | 27 CrosLibrary::Get()->GetNetworkLibrary()->RemoveNetworkManagerObserver(this); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 43 if (!obj->wifi_scanning()) { | 43 if (!obj->wifi_scanning()) { |
| 44 automation_->OnNetworkLibraryInit(); | 44 automation_->OnNetworkLibraryInit(); |
| 45 delete this; | 45 delete this; |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 LoginWebuiReadyObserver::LoginWebuiReadyObserver( | 49 LoginWebuiReadyObserver::LoginWebuiReadyObserver( |
| 50 AutomationProvider* automation) | 50 AutomationProvider* automation) |
| 51 : automation_(automation->AsWeakPtr()) { | 51 : automation_(automation->AsWeakPtr()) { |
| 52 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, | 52 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, |
| 53 NotificationService::AllSources()); | 53 content::NotificationService::AllSources()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 LoginWebuiReadyObserver::~LoginWebuiReadyObserver() { | 56 LoginWebuiReadyObserver::~LoginWebuiReadyObserver() { |
| 57 } | 57 } |
| 58 | 58 |
| 59 void LoginWebuiReadyObserver::Observe( | 59 void LoginWebuiReadyObserver::Observe( |
| 60 int type, | 60 int type, |
| 61 const content::NotificationSource& source, | 61 const content::NotificationSource& source, |
| 62 const content::NotificationDetails& details) { | 62 const content::NotificationDetails& details) { |
| 63 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY); | 63 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 | 99 |
| 100 ScreenLockUnlockObserver::ScreenLockUnlockObserver( | 100 ScreenLockUnlockObserver::ScreenLockUnlockObserver( |
| 101 AutomationProvider* automation, | 101 AutomationProvider* automation, |
| 102 IPC::Message* reply_message, | 102 IPC::Message* reply_message, |
| 103 bool lock_screen) | 103 bool lock_screen) |
| 104 : automation_(automation->AsWeakPtr()), | 104 : automation_(automation->AsWeakPtr()), |
| 105 reply_message_(reply_message), | 105 reply_message_(reply_message), |
| 106 lock_screen_(lock_screen) { | 106 lock_screen_(lock_screen) { |
| 107 registrar_.Add(this, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 107 registrar_.Add(this, chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
| 108 NotificationService::AllSources()); | 108 content::NotificationService::AllSources()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 ScreenLockUnlockObserver::~ScreenLockUnlockObserver() {} | 111 ScreenLockUnlockObserver::~ScreenLockUnlockObserver() {} |
| 112 | 112 |
| 113 void ScreenLockUnlockObserver::Observe( | 113 void ScreenLockUnlockObserver::Observe( |
| 114 int type, | 114 int type, |
| 115 const content::NotificationSource& source, | 115 const content::NotificationSource& source, |
| 116 const content::NotificationDetails& details) { | 116 const content::NotificationDetails& details) { |
| 117 DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED); | 117 DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED); |
| 118 if (automation_) { | 118 if (automation_) { |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 user_manager->SaveUserImage( | 479 user_manager->SaveUserImage( |
| 480 user.email(), photo, chromeos::UserManager::User::kExternalImageIndex); | 480 user.email(), photo, chromeos::UserManager::User::kExternalImageIndex); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void PhotoCaptureObserver::LocalStateChanged( | 483 void PhotoCaptureObserver::LocalStateChanged( |
| 484 chromeos::UserManager* user_manager) { | 484 chromeos::UserManager* user_manager) { |
| 485 user_manager->RemoveObserver(this); | 485 user_manager->RemoveObserver(this); |
| 486 AutomationJSONReply(automation_, reply_message_.release()).SendSuccess(NULL); | 486 AutomationJSONReply(automation_, reply_message_.release()).SendSuccess(NULL); |
| 487 delete this; | 487 delete this; |
| 488 } | 488 } |
| OLD | NEW |