Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: chrome/browser/automation/automation_event_observers_chromeos.cc

Issue 10408072: Rewrite of the EnrollEnterpriseDevice PyAuto automation hook for WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed nits. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser_process.h" 6 #include "chrome/browser/browser_process.h"
7 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen_ actor.h"
7 #include "chrome/browser/chromeos/login/existing_user_controller.h" 8 #include "chrome/browser/chromeos/login/existing_user_controller.h"
8 9
9 LoginEventObserver::LoginEventObserver( 10 LoginEventObserver::LoginEventObserver(
10 AutomationEventQueue* event_queue, 11 AutomationEventQueue* event_queue,
11 chromeos::ExistingUserController* controller, 12 chromeos::ExistingUserController* controller,
12 AutomationProvider* automation) 13 AutomationProvider* automation)
13 : AutomationEventObserver(event_queue, false), 14 : AutomationEventObserver(event_queue, false),
14 controller_(controller), 15 controller_(controller),
15 automation_(automation->AsWeakPtr()) { 16 automation_(automation->AsWeakPtr()) {
16 controller_->set_login_status_consumer(this); 17 controller_->set_login_status_consumer(this);
(...skipping 20 matching lines...) Expand all
37 38
38 void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) { 39 void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) {
39 DictionaryValue* dict = new DictionaryValue; 40 DictionaryValue* dict = new DictionaryValue;
40 dict->SetString("type", "login_event"); 41 dict->SetString("type", "login_event");
41 if (error_string.length()) 42 if (error_string.length())
42 dict->SetString("error_string", error_string); 43 dict->SetString("error_string", error_string);
43 NotifyEvent(dict); 44 NotifyEvent(dict);
44 controller_->set_login_status_consumer(NULL); 45 controller_->set_login_status_consumer(NULL);
45 RemoveIfDone(); 46 RemoveIfDone();
46 } 47 }
48
49 EnrollmentEventObserver::EnrollmentEventObserver(
50 AutomationEventQueue* event_queue,
51 chromeos::EnterpriseEnrollmentScreenActor* enrollment_screen_actor)
52 : AutomationEventObserver(event_queue, false) {
53 enrollment_screen_actor->AddObserver(this);
54 }
55
56 EnrollmentEventObserver::~EnrollmentEventObserver() {}
57
58 void EnrollmentEventObserver::OnEnrollmentComplete(
59 chromeos::EnterpriseEnrollmentScreenActor* enrollment_screen_actor,
60 bool succeeded,
61 const std::string& error_string) {
62 DictionaryValue* dict = new DictionaryValue;
63 enrollment_screen_actor->RemoveObserver(this);
64 if (!succeeded)
65 dict->SetString("error_string", error_string);
66 NotifyEvent(dict);
67 RemoveIfDone();
68 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_event_observers.h ('k') | chrome/browser/automation/automation_provider_observers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698