| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/components/tether/initializer.h" | 5 #include "chromeos/components/tether/initializer.h" |
| 6 | 6 |
| 7 #include "chromeos/components/tether/active_host.h" |
| 8 #include "chromeos/components/tether/host_scan_device_prioritizer.h" |
| 9 |
| 7 namespace chromeos { | 10 namespace chromeos { |
| 8 | 11 |
| 9 namespace tether { | 12 namespace tether { |
| 10 | 13 |
| 11 // static | 14 // static |
| 12 Initializer* Initializer::instance_ = nullptr; | 15 Initializer* Initializer::instance_ = nullptr; |
| 13 | 16 |
| 14 void Initializer::Initialize(cryptauth::CryptAuthService* cryptauth_service) { | 17 void Initializer::Initialize(cryptauth::CryptAuthService* cryptauth_service) { |
| 15 if (instance_) { | 18 if (instance_) { |
| 16 // TODO(khorimoto): Determine if a new instance should be created. | 19 // TODO(khorimoto): Determine if a new instance should be created. |
| 17 instance_->cryptauth_service_ = cryptauth_service; | 20 instance_->cryptauth_service_ = cryptauth_service; |
| 18 } else { | 21 } else { |
| 19 instance_ = new Initializer(cryptauth_service); | 22 instance_ = new Initializer(cryptauth_service); |
| 20 } | 23 } |
| 21 } | 24 } |
| 22 | 25 |
| 26 // static |
| 27 void Initializer::RegisterProfilePrefs(PrefRegistrySimple* registry) { |
| 28 ActiveHost::RegisterPrefs(registry); |
| 29 HostScanDevicePrioritizer::RegisterPrefs(registry); |
| 30 } |
| 31 |
| 23 Initializer::Initializer(cryptauth::CryptAuthService* cryptauth_service) | 32 Initializer::Initializer(cryptauth::CryptAuthService* cryptauth_service) |
| 24 : cryptauth_service_(cryptauth_service) {} | 33 : cryptauth_service_(cryptauth_service) {} |
| 25 | 34 |
| 26 Initializer::~Initializer() {} | 35 Initializer::~Initializer() {} |
| 27 | 36 |
| 28 } // namespace tether | 37 } // namespace tether |
| 29 | 38 |
| 30 } // namespace chromeos | 39 } // namespace chromeos |
| OLD | NEW |