OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "device/nfc/nfc_adapter_factory.h" | 5 #include "device/nfc/nfc_adapter_factory.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "build/build_config.h" |
10 | 11 |
11 #if defined(OS_CHROMEOS) | 12 #if defined(OS_CHROMEOS) |
12 #include "device/nfc/nfc_adapter_chromeos.h" | 13 #include "device/nfc/nfc_adapter_chromeos.h" |
13 #endif | 14 #endif |
14 | 15 |
15 namespace device { | 16 namespace device { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 // Shared default adapter instance, we don't want to keep this class around | 20 // Shared default adapter instance, we don't want to keep this class around |
(...skipping 25 matching lines...) Expand all Loading... |
45 chromeos::NfcAdapterChromeOS* new_adapter = | 46 chromeos::NfcAdapterChromeOS* new_adapter = |
46 new chromeos::NfcAdapterChromeOS(); | 47 new chromeos::NfcAdapterChromeOS(); |
47 default_adapter.Get() = new_adapter->weak_ptr_factory_.GetWeakPtr(); | 48 default_adapter.Get() = new_adapter->weak_ptr_factory_.GetWeakPtr(); |
48 #endif | 49 #endif |
49 } | 50 } |
50 if (default_adapter.Get()->IsInitialized()) | 51 if (default_adapter.Get()->IsInitialized()) |
51 callback.Run(scoped_refptr<NfcAdapter>(default_adapter.Get().get())); | 52 callback.Run(scoped_refptr<NfcAdapter>(default_adapter.Get().get())); |
52 } | 53 } |
53 | 54 |
54 } // namespace device | 55 } // namespace device |
OLD | NEW |