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_event_observers.h" | 5 #include "chrome/browser/automation/automation_event_observers.h" |
6 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 6 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
7 | 7 |
8 LoginEventObserver::LoginEventObserver( | 8 LoginEventObserver::LoginEventObserver( |
9 AutomationEventQueue* event_queue, | 9 AutomationEventQueue* event_queue, |
10 chromeos::ExistingUserController* controller) | 10 chromeos::ExistingUserController* controller) |
(...skipping 11 matching lines...) Expand all Loading... |
22 void LoginEventObserver::OnLoginSuccess(const std::string& username, | 22 void LoginEventObserver::OnLoginSuccess(const std::string& username, |
23 const std::string& password, | 23 const std::string& password, |
24 bool pending_requests, | 24 bool pending_requests, |
25 bool using_oauth) { | 25 bool using_oauth) { |
26 _NotifyLoginEvent(std::string()); | 26 _NotifyLoginEvent(std::string()); |
27 } | 27 } |
28 | 28 |
29 void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) { | 29 void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) { |
30 DictionaryValue* dict = new DictionaryValue; | 30 DictionaryValue* dict = new DictionaryValue; |
31 dict->SetString("type", "login_event"); | 31 dict->SetString("type", "login_event"); |
32 dict->SetInteger("observer_id", GetId()); | |
33 if (error_string.length()) | 32 if (error_string.length()) |
34 dict->SetString("error_string", error_string); | 33 dict->SetString("error_string", error_string); |
35 NotifyEvent(dict); | 34 NotifyEvent(dict); |
36 controller_->set_login_status_consumer(NULL); | 35 controller_->set_login_status_consumer(NULL); |
37 RemoveIfDone(); | 36 RemoveIfDone(); |
38 } | 37 } |
OLD | NEW |