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

Side by Side Diff: content/browser/geolocation/gps_location_provider_linux.cc

Issue 10107017: Remove requesting_frame parameters from Geolocation stack (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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
OLDNEW
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/gps_location_provider_linux.h" 5 #include "content/browser/geolocation/gps_location_provider_linux.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void GpsLocationProviderLinux::GetPosition(Geoposition* position) { 84 void GpsLocationProviderLinux::GetPosition(Geoposition* position) {
85 DCHECK(position); 85 DCHECK(position);
86 *position = position_; 86 *position = position_;
87 DCHECK(position->IsInitialized()); 87 DCHECK(position->IsInitialized());
88 } 88 }
89 89
90 void GpsLocationProviderLinux::UpdatePosition() { 90 void GpsLocationProviderLinux::UpdatePosition() {
91 ScheduleNextGpsPoll(0); 91 ScheduleNextGpsPoll(0);
92 } 92 }
93 93
94 void GpsLocationProviderLinux::OnPermissionGranted(
95 const GURL& requesting_frame) {
96 }
97
98 void GpsLocationProviderLinux::DoGpsPollTask() { 94 void GpsLocationProviderLinux::DoGpsPollTask() {
99 if (!gps_->Start()) { 95 if (!gps_->Start()) {
100 DLOG(WARNING) << "Couldn't start GPS provider."; 96 DLOG(WARNING) << "Couldn't start GPS provider.";
101 ScheduleNextGpsPoll(gpsd_reconnect_interval_millis_); 97 ScheduleNextGpsPoll(gpsd_reconnect_interval_millis_);
102 return; 98 return;
103 } 99 }
104 100
105 Geoposition new_position; 101 Geoposition new_position;
106 if (!gps_->Read(&new_position)) { 102 if (!gps_->Read(&new_position)) {
107 ScheduleNextGpsPoll(poll_period_stationary_millis_); 103 ScheduleNextGpsPoll(poll_period_stationary_millis_);
(...skipping 16 matching lines...) Expand all
124 MessageLoop::current()->PostDelayedTask( 120 MessageLoop::current()->PostDelayedTask(
125 FROM_HERE, 121 FROM_HERE,
126 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, 122 base::Bind(&GpsLocationProviderLinux::DoGpsPollTask,
127 weak_factory_.GetWeakPtr()), 123 weak_factory_.GetWeakPtr()),
128 base::TimeDelta::FromMilliseconds(interval)); 124 base::TimeDelta::FromMilliseconds(interval));
129 } 125 }
130 126
131 LocationProviderBase* NewSystemLocationProvider() { 127 LocationProviderBase* NewSystemLocationProvider() {
132 return new GpsLocationProviderLinux(LibGps::New); 128 return new GpsLocationProviderLinux(LibGps::New);
133 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698