Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Side by Side Diff: chrome/common/geoposition.cc

Issue 6576020: Remove Gears from Chrome (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: windows fixes Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/gears_api.h ('k') | chrome/common/net/url_fetcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/geoposition.h" 5 #include "chrome/common/geoposition.h"
6 6
7 namespace { 7 namespace {
8 // Sentinel values to mark invalid data. (WebKit carries companion is_valid 8 // Sentinel values to mark invalid data. (WebKit carries companion is_valid
9 // bools for this purpose; we may eventually follow that approach, but 9 // bools for this purpose; we may eventually follow that approach, but
10 // sentinels worked OK in the gears code this is based on.) 10 // sentinels worked OK in the Gears code this is based on.)
11 const double kBadLatitudeLongitude = 200; 11 const double kBadLatitudeLongitude = 200;
12 // Lowest point on land is at approximately -400 meters. 12 // Lowest point on land is at approximately -400 meters.
13 const int kBadAltitude = -10000; 13 const int kBadAltitude = -10000;
14 const int kBadAccuracy = -1; // Accuracy must be non-negative. 14 const int kBadAccuracy = -1; // Accuracy must be non-negative.
15 const int64 kBadTimestamp = kint64min; 15 const int64 kBadTimestamp = kint64min;
16 const int kBadHeading = -1; // Heading must be non-negative. 16 const int kBadHeading = -1; // Heading must be non-negative.
17 const int kBadSpeed = -1; 17 const int kBadSpeed = -1;
18 } 18 }
19 19
20 Geoposition::Geoposition() 20 Geoposition::Geoposition()
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return !timestamp.is_null(); 57 return !timestamp.is_null();
58 } 58 }
59 59
60 bool Geoposition::IsValidFix() const { 60 bool Geoposition::IsValidFix() const {
61 return is_valid_latlong() && is_valid_accuracy() && is_valid_timestamp(); 61 return is_valid_latlong() && is_valid_accuracy() && is_valid_timestamp();
62 } 62 }
63 63
64 bool Geoposition::IsInitialized() const { 64 bool Geoposition::IsInitialized() const {
65 return error_code != ERROR_CODE_NONE || IsValidFix(); 65 return error_code != ERROR_CODE_NONE || IsValidFix();
66 } 66 }
OLDNEW
« no previous file with comments | « chrome/common/gears_api.h ('k') | chrome/common/net/url_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698