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 "chrome/browser/local_discovery/wifi/wifi_manager.h" | 5 #include "chrome/browser/local_discovery/wifi/wifi_manager.h" |
6 | 6 |
7 namespace local_discovery { | 7 namespace local_discovery { |
8 | 8 |
9 namespace wifi { | 9 namespace wifi { |
10 | 10 |
| 11 namespace { |
| 12 |
| 13 WifiManagerFactory* g_factory = NULL; |
| 14 |
| 15 } // namespace |
| 16 |
| 17 scoped_ptr<WifiManager> WifiManager::Create() { |
| 18 if (g_factory) { |
| 19 return g_factory->CreateWifiManager(); |
| 20 } |
| 21 |
| 22 return CreateDefault(); |
| 23 } |
| 24 |
| 25 void WifiManager::SetFactory(WifiManagerFactory* factory) { |
| 26 g_factory = factory; |
| 27 } |
| 28 |
11 WifiCredentials WifiCredentials::FromPSK(const std::string& psk) { | 29 WifiCredentials WifiCredentials::FromPSK(const std::string& psk) { |
12 WifiCredentials return_value; | 30 WifiCredentials return_value; |
13 return_value.psk = psk; | 31 return_value.psk = psk; |
14 return return_value; | 32 return return_value; |
15 } | 33 } |
16 | 34 |
17 } // namespace wifi | 35 } // namespace wifi |
18 | 36 |
19 } // namespace local_discovery | 37 } // namespace local_discovery |
OLD | NEW |