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

Unified Diff: ui/chromeos/pairing/controller_pairing_flow.h

Issue 304603002: Created paring flow interface for controller side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « ui/chromeos/pairing/OWNERS ('k') | ui/chromeos/ui_chromeos.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/chromeos/pairing/controller_pairing_flow.h
diff --git a/ui/chromeos/pairing/controller_pairing_flow.h b/ui/chromeos/pairing/controller_pairing_flow.h
new file mode 100644
index 0000000000000000000000000000000000000000..49e9fa5abbf1e4ba06d6202ce0e7793d5ae05d5f
--- /dev/null
+++ b/ui/chromeos/pairing/controller_pairing_flow.h
@@ -0,0 +1,93 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_CHROMEOS_PAIRING_CONTROLLER_PAIRING_FLOW_H_
+#define UI_CHROMEOS_PAIRING_CONTROLLER_PAIRING_FLOW_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "ui/chromeos/ui_chromeos_export.h"
+
+namespace chromeos {
+class UserContext;
+}
+
+namespace content {
+class BrowserContext;
+}
+
+namespace ui {
+
+class UI_CHROMEOS_EXPORT ControllerPairingFlow {
+ public:
+ enum Stage {
+ STAGE_NONE,
+ STAGE_SCANNING_FOR_DEVICES,
+ STAGE_DEVICE_NOT_FOUND,
+ STAGE_WAITING_FOR_DEVICE_SELECTION,
+ STAGE_ESTABLISHING_CONNECTION,
+ STAGE_WATING_FOR_CODE_CONFIRMATION,
+ STAGE_HOST_UPDATE_IN_PROGRESS,
+ STAGE_HOST_CONNECTION_LOST,
+ STAGE_WAITING_FOR_CREDENTIALS,
+ STAGE_HOST_ENROLLMENT_IN_PROGRESS,
+ STAGE_HOST_ENROLLMENT_ERROR,
+ STAGE_PAIRING_DONE,
+ STAGE_STARTING_SESSION,
+ STAGE_FINISHED
+ };
+
+ class Observer {
+ public:
+ virtual ~Observer() {};
+
+ // Called when flow has moved on from one stage to another.
+ virtual void PairingStageChanged(Stage previous_stage, Stage new_stage) = 0;
Zachary Kuznia 2014/05/27 23:46:43 Why do you expect the previous stage to be sent he
dzhioev (left Google) 2014/05/28 10:38:30 Yes, probably |previous_stage| is excess.
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Observer);
+ };
+
+ public:
+ virtual ~ControllerPairingFlow() {}
+
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ // Returns current stage of flow.
+ virtual Stage GetCurrentStage() = 0;
+
+ // Starts pairing flow. Can be called only on |STAGE_NONE| stage.
+ virtual void StartFlow() = 0;
+
+ // Rescan for devices to pair with. Can be called only on
+ // |STAGE_DEVICE_NOT_FOUND| stage.
+ virtual void RepeatScanning() = 0;
+
+ // Called to confirm or deny confirmation code. Can be called only on
+ // |STAGE_WAITING_FOR_CODE_CONFIRMATION| stage.
+ virtual void SetConfirmationCodeIsRight(bool right) = 0;
+
+ // Called when user successfully authenticated on GAIA page. Can be called
+ // only on |STAGE_WAITING_FOR_CREDENTIALS|.
+ virtual void OnAuthenticationDone(
+ const chromeos::UserContext& user_context,
+ content::BrowserContext* browser_context) = 0;
+
+ // Installs app and starts session.
+ // Can be called only on |STAGE_PAIRING_DONE| stage.
+ virtual void StartSession() = 0;
+
+ // Returns pairing confirmation code.
+ // Could be called only on |STATE_WAITING_FOR_CODE_CONFIRMATION| stage.
+ virtual std::string GetConfirmationCode() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ControllerPairingFlow);
+};
+
+} // namespace ui
+
+#endif // UI_CHROMEOS_PAIRING_CONTROLLER_PAIRING_FLOW_H_
« no previous file with comments | « ui/chromeos/pairing/OWNERS ('k') | ui/chromeos/ui_chromeos.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698