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

Unified Diff: components/pairing/host_pairing_controller.h

Issue 491943004: Update the pairing API to include configuration and enrollment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 6 years, 4 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
« no previous file with comments | « components/pairing/fake_host_pairing_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/pairing/host_pairing_controller.h
diff --git a/components/pairing/host_pairing_controller.h b/components/pairing/host_pairing_controller.h
index 7d14b6e9c8a3ffb8566b9b501088e12a901ae79c..207fef5b6b4a46e96ca06b1af43a2c385ff91194 100644
--- a/components/pairing/host_pairing_controller.h
+++ b/components/pairing/host_pairing_controller.h
@@ -15,6 +15,7 @@ class HostPairingController {
public:
enum Stage {
STAGE_NONE,
+ STAGE_INITIALIZATION_ERROR,
STAGE_WAITING_FOR_CONTROLLER,
STAGE_WAITING_FOR_CODE_CONFIRMATION,
STAGE_UPDATING,
@@ -26,9 +27,11 @@ class HostPairingController {
STAGE_FINISHED
};
- struct UpdateProgress {
- // Number in [0, 1].
- double progress;
+ enum UpdateStatus {
+ UPDATE_STATUS_UNKNOWN,
+ UPDATE_STATUS_UPDATING,
+ UPDATE_STATUS_REBOOTING,
+ UPDATE_STATUS_UPDATED,
};
class Observer {
@@ -39,9 +42,15 @@ class HostPairingController {
// Called when pairing has moved on from one stage to another.
virtual void PairingStageChanged(Stage new_stage) = 0;
- // Called periodically on |STAGE_UPDATING| stage. Current update progress
- // is stored in |progress|.
- virtual void UpdateAdvanced(const UpdateProgress& progress) = 0;
+ // Called when the controller has sent a configuration to apply.
+ virtual void ConfigureHost(bool accepted_eula,
+ const std::string& lang,
+ const std::string& timezone,
+ bool send_reports,
+ const std::string& keyboard_layout) = 0;
+
+ // Called when the controller has provided an |auth_token| for enrollment.
+ virtual void EnrollHost(const std::string& auth_token) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(Observer);
@@ -50,9 +59,6 @@ class HostPairingController {
HostPairingController();
virtual ~HostPairingController();
- virtual void AddObserver(Observer* observer) = 0;
- virtual void RemoveObserver(Observer* observer) = 0;
-
// Returns current stage of pairing process.
virtual Stage GetCurrentStage() = 0;
@@ -70,6 +76,13 @@ class HostPairingController {
// |STAGE_ENROLLMENT| and later.
virtual std::string GetEnrollmentDomain() = 0;
+ // Notify that the update status has changed.
+ // Can be called on stage |STAGE_UPDATING|.
+ virtual void OnUpdateStatusChanged(UpdateStatus update_status) = 0;
+
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(HostPairingController);
};
« no previous file with comments | « components/pairing/fake_host_pairing_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698