| 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 #include "chromeos/pairing/fake_host_pairing_controller.h" | 5 #include "components/pairing/fake_host_pairing_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 const int kUpdateStepsNumber = 10; | 19 const int kUpdateStepsNumber = 10; |
| 20 const int kDefaultAsyncDurationMs = 3000; | 20 const int kDefaultAsyncDurationMs = 3000; |
| 21 const size_t kCodeLength = 6; | 21 const size_t kCodeLength = 6; |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 namespace chromeos { | 25 namespace pairing_chromeos { |
| 26 | 26 |
| 27 FakeHostPairingController::FakeHostPairingController(const std::string& config) | 27 FakeHostPairingController::FakeHostPairingController(const std::string& config) |
| 28 : current_stage_(STAGE_NONE), | 28 : current_stage_(STAGE_NONE), |
| 29 enrollment_should_fail_(false), | 29 enrollment_should_fail_(false), |
| 30 start_after_update_(false) { | 30 start_after_update_(false) { |
| 31 ApplyConfig(config); | 31 ApplyConfig(config); |
| 32 AddObserver(this); | 32 AddObserver(this); |
| 33 } | 33 } |
| 34 | 34 |
| 35 FakeHostPairingController::~FakeHostPairingController() { | 35 FakeHostPairingController::~FakeHostPairingController() { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ChangeStageLater(STAGE_FINISHED); | 182 ChangeStageLater(STAGE_FINISHED); |
| 183 break; | 183 break; |
| 184 } | 184 } |
| 185 default: { break; } | 185 default: { break; } |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 | 188 |
| 189 void FakeHostPairingController::UpdateAdvanced(const UpdateProgress& progress) { | 189 void FakeHostPairingController::UpdateAdvanced(const UpdateProgress& progress) { |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace chromeos | 192 } // namespace pairing_chromeos |
| OLD | NEW |