OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/geolocation/wifi_data_provider_common.h" | 5 #include "device/geolocation/wifi_data_provider_common.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 | 12 |
13 namespace content { | 13 namespace device { |
14 | 14 |
15 base::string16 MacAddressAsString16(const uint8_t mac_as_int[6]) { | 15 base::string16 MacAddressAsString16(const uint8_t mac_as_int[6]) { |
16 // mac_as_int is big-endian. Write in byte chunks. | 16 // mac_as_int is big-endian. Write in byte chunks. |
17 // Format is XX-XX-XX-XX-XX-XX. | 17 // Format is XX-XX-XX-XX-XX-XX. |
18 static const char* const kMacFormatString = | 18 static const char* const kMacFormatString = |
19 "%02x-%02x-%02x-%02x-%02x-%02x"; | 19 "%02x-%02x-%02x-%02x-%02x-%02x"; |
20 return base::ASCIIToUTF16(base::StringPrintf(kMacFormatString, | 20 return base::ASCIIToUTF16(base::StringPrintf(kMacFormatString, |
21 mac_as_int[0], | 21 mac_as_int[0], |
22 mac_as_int[1], | 22 mac_as_int[1], |
23 mac_as_int[2], | 23 mac_as_int[2], |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 void WifiDataProviderCommon::ScheduleNextScan(int interval) { | 84 void WifiDataProviderCommon::ScheduleNextScan(int interval) { |
85 client_task_runner()->PostDelayedTask( | 85 client_task_runner()->PostDelayedTask( |
86 FROM_HERE, base::Bind(&WifiDataProviderCommon::DoWifiScanTask, | 86 FROM_HERE, base::Bind(&WifiDataProviderCommon::DoWifiScanTask, |
87 weak_factory_.GetWeakPtr()), | 87 weak_factory_.GetWeakPtr()), |
88 base::TimeDelta::FromMilliseconds(interval)); | 88 base::TimeDelta::FromMilliseconds(interval)); |
89 } | 89 } |
90 | 90 |
91 } // namespace content | 91 } // namespace device |
OLD | NEW |