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 "content/browser/geolocation/geolocation_service_impl.h" | 5 #include "device/geolocation/geolocation_service_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "content/browser/geolocation/geolocation_service_context.h" | 11 #include "device/geolocation/geolocation_service_context.h" |
12 | 12 |
13 namespace content { | 13 namespace device { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // Geoposition error codes for reporting in UMA. | 17 // Geoposition error codes for reporting in UMA. |
18 enum GeopositionErrorCode { | 18 enum GeopositionErrorCode { |
19 // NOTE: Do not renumber these as that would confuse interpretation of | 19 // NOTE: Do not renumber these as that would confuse interpretation of |
20 // previously logged data. When making changes, also update the enum list | 20 // previously logged data. When making changes, also update the enum list |
21 // in tools/metrics/histograms/histograms.xml to keep it in sync. | 21 // in tools/metrics/histograms/histograms.xml to keep it in sync. |
22 | 22 |
23 // There was no error. | 23 // There was no error. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 if (!position_callback_.is_null()) | 185 if (!position_callback_.is_null()) |
186 ReportCurrentPosition(); | 186 ReportCurrentPosition(); |
187 } | 187 } |
188 | 188 |
189 void GeolocationServiceImpl::ReportCurrentPosition() { | 189 void GeolocationServiceImpl::ReportCurrentPosition() { |
190 position_callback_.Run(current_position_.Clone()); | 190 position_callback_.Run(current_position_.Clone()); |
191 position_callback_.Reset(); | 191 position_callback_.Reset(); |
192 has_position_to_report_ = false; | 192 has_position_to_report_ = false; |
193 } | 193 } |
194 | 194 |
195 } // namespace content | 195 } // namespace device |
OLD | NEW |