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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_event_observers_chromeos.cc
diff --git a/chrome/browser/automation/automation_event_observers_chromeos.cc b/chrome/browser/automation/automation_event_observers_chromeos.cc
index e3da47d840fa0fe762c7990afa36611169e63006..aab17b7411b7c45fbcdae821b8c3a226131245e5 100644
--- a/chrome/browser/automation/automation_event_observers_chromeos.cc
+++ b/chrome/browser/automation/automation_event_observers_chromeos.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/automation/automation_event_observers.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_screen_actor.h"
#include "chrome/browser/chromeos/login/existing_user_controller.h"
LoginEventObserver::LoginEventObserver(
@@ -44,3 +45,24 @@ void LoginEventObserver::_NotifyLoginEvent(const std::string& error_string) {
controller_->set_login_status_consumer(NULL);
RemoveIfDone();
}
+
+EnrollmentEventObserver::EnrollmentEventObserver(
+ AutomationEventQueue* event_queue,
+ chromeos::EnterpriseEnrollmentScreenActor* enrollment_screen_actor)
+ : AutomationEventObserver(event_queue, false) {
+ enrollment_screen_actor->AddObserver(this);
+}
+
+EnrollmentEventObserver::~EnrollmentEventObserver() {}
+
+void EnrollmentEventObserver::OnEnrollmentComplete(
+ chromeos::EnterpriseEnrollmentScreenActor* enrollment_screen_actor,
+ bool succeeded,
+ const std::string& error_string) {
+ DictionaryValue* dict = new DictionaryValue;
+ enrollment_screen_actor->RemoveObserver(this);
+ if (!succeeded)
+ dict->SetString("error_string", error_string);
+ NotifyEvent(dict);
+ RemoveIfDone();
+}
« 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