Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ | 5 #ifndef COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ |
| 6 #define CHROMEOS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ | 6 #define COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
|
jochen (gone - plz use gerrit)
2014/07/17 07:14:19
if you use base, you should depend on it in gyp
Zachary Kuznia
2014/07/17 22:14:47
Done.
| |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "chromeos/chromeos_export.h" | 11 #include "components/pairing/host_pairing_controller.h" |
| 12 #include "chromeos/pairing/host_pairing_controller.h" | 12 #include "components/pairing/pairing_export.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace pairing_chromeos { |
| 15 | 15 |
| 16 class CHROMEOS_EXPORT FakeHostPairingController | 16 class PAIRING_EXPORT FakeHostPairingController |
| 17 : public HostPairingController, | 17 : public HostPairingController, |
| 18 public HostPairingController::Observer { | 18 public HostPairingController::Observer { |
| 19 public: | 19 public: |
| 20 typedef HostPairingController::Observer Observer; | 20 typedef HostPairingController::Observer Observer; |
| 21 | 21 |
| 22 // Config is a comma separated list of key-value pairs separated by colon. | 22 // Config is a comma separated list of key-value pairs separated by colon. |
| 23 // Supported options: | 23 // Supported options: |
| 24 // * async_duration - integer. Default: 3000. | 24 // * async_duration - integer. Default: 3000. |
| 25 // * start_after_update - {0,1}. Default: 0. | 25 // * start_after_update - {0,1}. Default: 0. |
| 26 // * fail_enrollment - {0,1}. Default: 0. | 26 // * fail_enrollment - {0,1}. Default: 0. |
| 27 // * code - 6 digits or empty string. Default: empty string. If strings is | 27 // * code - 6 digits or empty string. Default: empty string. If strings is |
| 28 // empty, random code is generated. | 28 // empty, random code is generated. |
| 29 // * device_name - string. Default: "Chromebox-01". | 29 // * device_name - string. Default: "Chromebox-01". |
| 30 // * domain - string. Default: "example.com". | 30 // * domain - string. Default: "example.com". |
| 31 FakeHostPairingController(const std::string& config); | 31 explicit FakeHostPairingController(const std::string& config); |
| 32 virtual ~FakeHostPairingController(); | 32 virtual ~FakeHostPairingController(); |
| 33 | 33 |
| 34 // Applies given |config| to flow. | 34 // Applies given |config| to flow. |
| 35 void ApplyConfig(const std::string& config); | 35 void ApplyConfig(const std::string& config); |
| 36 | 36 |
| 37 // Overridden from HostPairingFlow: | 37 // Overridden from HostPairingFlow: |
| 38 virtual void AddObserver(Observer* observer) OVERRIDE; | 38 virtual void AddObserver(Observer* observer) OVERRIDE; |
| 39 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 39 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
| 40 virtual Stage GetCurrentStage() OVERRIDE; | 40 virtual Stage GetCurrentStage() OVERRIDE; |
| 41 virtual void StartPairing() OVERRIDE; | 41 virtual void StartPairing() OVERRIDE; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 62 bool enrollment_should_fail_; | 62 bool enrollment_should_fail_; |
| 63 | 63 |
| 64 // Controller starts its work like if update and reboot already happened. | 64 // Controller starts its work like if update and reboot already happened. |
| 65 bool start_after_update_; | 65 bool start_after_update_; |
| 66 | 66 |
| 67 std::string enrollment_domain_; | 67 std::string enrollment_domain_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(FakeHostPairingController); | 69 DISALLOW_COPY_AND_ASSIGN(FakeHostPairingController); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace chromeos | 72 } // namespace pairing_chromeos |
| 73 | 73 |
| 74 #endif // CHROMEOS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ | 74 #endif // COMPONENTS_PAIRING_FAKE_HOST_PAIRING_CONTROLLER_H_ |
| OLD | NEW |