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/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" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 delete this; | 47 delete this; |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 LoginWebuiReadyObserver::LoginWebuiReadyObserver(AutomationProvider* automation) | 51 LoginWebuiReadyObserver::LoginWebuiReadyObserver(AutomationProvider* automation) |
52 : automation_(automation->AsWeakPtr()) { | 52 : automation_(automation->AsWeakPtr()) { |
53 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, | 53 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, |
54 content::NotificationService::AllSources()); | 54 content::NotificationService::AllSources()); |
55 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED, | 55 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED, |
56 content::NotificationService::AllSources()); | 56 content::NotificationService::AllSources()); |
57 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN, | |
58 content::NotificationService::AllSources()); | |
59 registrar_.Add(this, chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN, | 57 registrar_.Add(this, chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN, |
60 content::NotificationService::AllSources()); | 58 content::NotificationService::AllSources()); |
61 } | 59 } |
62 | 60 |
63 void LoginWebuiReadyObserver::Observe( | 61 void LoginWebuiReadyObserver::Observe( |
64 int type, | 62 int type, |
65 const content::NotificationSource& source, | 63 const content::NotificationSource& source, |
66 const content::NotificationDetails& details) { | 64 const content::NotificationDetails& details) { |
67 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY || | 65 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY || |
68 type == chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED || | 66 type == chrome::NOTIFICATION_LOGIN_USER_IMAGES_LOADED || |
69 type == chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN || | |
70 type == chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN); | 67 type == chrome::NOTIFICATION_WIZARD_FIRST_SCREEN_SHOWN); |
71 if (automation_) | 68 if (automation_) |
72 automation_->OnLoginWebuiReady(); | 69 automation_->OnLoginWebuiReady(); |
73 delete this; | 70 delete this; |
74 } | 71 } |
75 | 72 |
76 LoginObserver::LoginObserver(chromeos::ExistingUserController* controller, | 73 LoginObserver::LoginObserver(chromeos::ExistingUserController* controller, |
77 AutomationProvider* automation, | 74 AutomationProvider* automation, |
78 IPC::Message* reply_message) | 75 IPC::Message* reply_message) |
79 : controller_(controller), | 76 : controller_(controller), |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 455 |
459 void PhotoCaptureObserver::LocalStateChanged( | 456 void PhotoCaptureObserver::LocalStateChanged( |
460 chromeos::UserManager* user_manager) { | 457 chromeos::UserManager* user_manager) { |
461 user_manager->RemoveObserver(this); | 458 user_manager->RemoveObserver(this); |
462 if (automation_) { | 459 if (automation_) { |
463 AutomationJSONReply( | 460 AutomationJSONReply( |
464 automation_, reply_message_.release()).SendSuccess(NULL); | 461 automation_, reply_message_.release()).SendSuccess(NULL); |
465 } | 462 } |
466 delete this; | 463 delete this; |
467 } | 464 } |
OLD | NEW |