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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 automation_->OnNetworkLibraryInit(); | 46 automation_->OnNetworkLibraryInit(); |
47 delete this; | 47 delete this; |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 LoginWebuiReadyObserver::LoginWebuiReadyObserver( | 51 LoginWebuiReadyObserver::LoginWebuiReadyObserver( |
52 AutomationProvider* automation) | 52 AutomationProvider* automation) |
53 : automation_(automation->AsWeakPtr()) { | 53 : automation_(automation->AsWeakPtr()) { |
54 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, | 54 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_WEBUI_READY, |
55 content::NotificationService::AllSources()); | 55 content::NotificationService::AllSources()); |
56 } | 56 registrar_.Add(this, chrome::NOTIFICATION_ACCOUNT_PICKER_WEBUI_READY, |
Nikita (slow)
2012/05/16 15:56:13
Should add these instead:
NOTIFICATION_LOGIN_USER_
bartfab (slow)
2012/05/16 18:07:10
Thanks. I had seen that code but did not realize t
| |
57 | 57 content::NotificationService::AllSources()); |
58 LoginWebuiReadyObserver::~LoginWebuiReadyObserver() { | |
59 } | 58 } |
60 | 59 |
61 void LoginWebuiReadyObserver::Observe( | 60 void LoginWebuiReadyObserver::Observe( |
62 int type, | 61 int type, |
63 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
64 const content::NotificationDetails& details) { | 63 const content::NotificationDetails& details) { |
65 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY); | 64 DCHECK(type == chrome::NOTIFICATION_LOGIN_WEBUI_READY || |
65 type == chrome::NOTIFICATION_ACCOUNT_PICKER_WEBUI_READY); | |
66 if (automation_) | 66 if (automation_) |
67 automation_->OnLoginWebuiReady(); | 67 automation_->OnLoginWebuiReady(); |
68 delete this; | 68 delete this; |
69 } | 69 } |
70 | 70 |
71 LoginObserver::LoginObserver(chromeos::ExistingUserController* controller, | 71 LoginObserver::LoginObserver(chromeos::ExistingUserController* controller, |
72 AutomationProvider* automation, | 72 AutomationProvider* automation, |
73 IPC::Message* reply_message) | 73 IPC::Message* reply_message) |
74 : controller_(controller), | 74 : controller_(controller), |
75 automation_(automation->AsWeakPtr()), | 75 automation_(automation->AsWeakPtr()), |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 | 453 |
454 void PhotoCaptureObserver::LocalStateChanged( | 454 void PhotoCaptureObserver::LocalStateChanged( |
455 chromeos::UserManager* user_manager) { | 455 chromeos::UserManager* user_manager) { |
456 user_manager->RemoveObserver(this); | 456 user_manager->RemoveObserver(this); |
457 if (automation_) { | 457 if (automation_) { |
458 AutomationJSONReply( | 458 AutomationJSONReply( |
459 automation_, reply_message_.release()).SendSuccess(NULL); | 459 automation_, reply_message_.release()).SendSuccess(NULL); |
460 } | 460 } |
461 delete this; | 461 delete this; |
462 } | 462 } |
OLD | NEW |