Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_EVENT_OBSERVERS_H_ | 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_EVENT_OBSERVERS_H_ |
| 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_EVENT_OBSERVERS_H_ | 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_EVENT_OBSERVERS_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/automation/automation_event_queue.h" | 10 #include "chrome/browser/automation/automation_event_queue.h" |
| 11 #include "chrome/browser/automation/automation_provider.h" | 11 #include "chrome/browser/automation/automation_provider.h" |
| 12 #include "chrome/browser/automation/automation_provider_observers.h" | 12 #include "chrome/browser/automation/automation_provider_observers.h" |
| 13 #if defined(OS_CHROMEOS) | 13 #if defined(OS_CHROMEOS) |
| 14 #include "chrome/browser/chromeos/login/login_status_consumer.h" | 14 #include "chrome/browser/chromeos/login/login_status_consumer.h" |
| 15 #endif // defined(OS_CHROMEOS) | 15 #endif // defined(OS_CHROMEOS) |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 | 18 |
| 19 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
| 20 namespace chromeos { | 20 namespace chromeos { |
| 21 class EnterpriseEnrollmentScreenActor; | |
| 21 class ExistingUserController; | 22 class ExistingUserController; |
| 22 } | 23 } |
| 23 #endif // defined(OS_CHROMEOS) | 24 #endif // defined(OS_CHROMEOS) |
| 24 | 25 |
| 25 // AutomationEventObserver watches for a specific event, and pushes an | 26 // AutomationEventObserver watches for a specific event, and pushes an |
| 26 // AutomationEvent into the AutomationEventQueue for each occurance. | 27 // AutomationEvent into the AutomationEventQueue for each occurance. |
| 27 class AutomationEventObserver { | 28 class AutomationEventObserver { |
| 28 public: | 29 public: |
| 29 explicit AutomationEventObserver(AutomationEventQueue* event_queue, | 30 explicit AutomationEventObserver(AutomationEventQueue* event_queue, |
| 30 bool recurring); | 31 bool recurring); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 | 98 |
| 98 private: | 99 private: |
| 99 chromeos::ExistingUserController* controller_; | 100 chromeos::ExistingUserController* controller_; |
| 100 base::WeakPtr<AutomationProvider> automation_; | 101 base::WeakPtr<AutomationProvider> automation_; |
| 101 | 102 |
| 102 void _NotifyLoginEvent(const std::string& error_string); | 103 void _NotifyLoginEvent(const std::string& error_string); |
| 103 | 104 |
| 104 DISALLOW_COPY_AND_ASSIGN(LoginEventObserver); | 105 DISALLOW_COPY_AND_ASSIGN(LoginEventObserver); |
| 105 }; | 106 }; |
| 106 | 107 |
| 108 // Event observer that listens for enrollment to complete. | |
| 109 class EnrollmentEventObserver | |
| 110 : public AutomationEventObserver, | |
| 111 public chromeos::EnterpriseEnrollmentScreenActor::Observer { | |
| 112 public: | |
| 113 EnrollmentEventObserver( | |
| 114 AutomationEventQueue* event_queue, | |
| 115 chromeos::EnterpriseEnrollmentScreenActor* enrollment_screen_actor); | |
| 116 | |
| 117 virtual ~EnrollmentEventObserver(); | |
| 118 | |
| 119 // chromeos::EnterpriseEnrollmentScreenActor::Observer implementation. | |
| 120 virtual void OnEnrollmentComplete( | |
| 121 chromeos::EnterpriseEnrollmentScreenActor* enrollment_screen_actor, | |
| 122 bool succeeded, std::string error_string); | |
|
Mattias Nissler (ping if slow)
2012/05/23 19:47:50
All parameters go on separate lines in declaration
craigdh
2012/05/24 21:17:26
Done.
| |
| 123 | |
| 124 private: | |
| 125 | |
|
Mattias Nissler (ping if slow)
2012/05/23 19:47:50
nit: remove blank line.
craigdh
2012/05/24 21:17:26
Done.
| |
| 126 DISALLOW_COPY_AND_ASSIGN(EnrollmentEventObserver); | |
| 127 }; | |
| 128 | |
| 107 #endif // defined(OS_CHROMEOS) | 129 #endif // defined(OS_CHROMEOS) |
| 108 | 130 |
| 109 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_EVENT_OBSERVERS_H_ | 131 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_EVENT_OBSERVERS_H_ |
| OLD | NEW |