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/renderer/geolocation_dispatcher.h" | 5 #include "content/renderer/geolocation_dispatcher.h" |
6 | 6 |
7 #include "content/common/geolocation_messages.h" | 7 #include "content/common/geolocation_messages.h" |
8 #include "content/renderer/render_view_impl.h" | 8 #include "content/renderer/render_view_impl.h" |
9 #include "third_party/WebKit/public/platform/WebString.h" | 9 #include "third_party/WebKit/public/platform/WebString.h" |
10 #include "third_party/WebKit/public/web/WebGeolocationPermissionRequest.h" | 10 #include "third_party/WebKit/public/web/WebGeolocationPermissionRequest.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Send(new GeolocationHostMsg_StartUpdating( | 50 Send(new GeolocationHostMsg_StartUpdating( |
51 routing_id(), url, enable_high_accuracy_)); | 51 routing_id(), url, enable_high_accuracy_)); |
52 updating_ = true; | 52 updating_ = true; |
53 } | 53 } |
54 | 54 |
55 void GeolocationDispatcher::stopUpdating() { | 55 void GeolocationDispatcher::stopUpdating() { |
56 Send(new GeolocationHostMsg_StopUpdating(routing_id())); | 56 Send(new GeolocationHostMsg_StopUpdating(routing_id())); |
57 updating_ = false; | 57 updating_ = false; |
58 } | 58 } |
59 | 59 |
| 60 void GeolocationDispatcher::pauseOrResume(bool should_pause) { |
| 61 Send(new GeolocationHostMsg_PauseOrResume(routing_id(), should_pause)); |
| 62 } |
| 63 |
60 void GeolocationDispatcher::setEnableHighAccuracy(bool enable_high_accuracy) { | 64 void GeolocationDispatcher::setEnableHighAccuracy(bool enable_high_accuracy) { |
61 // GeolocationController calls setEnableHighAccuracy(true) before | 65 // GeolocationController calls setEnableHighAccuracy(true) before |
62 // startUpdating in response to the first high-accuracy Geolocation | 66 // startUpdating in response to the first high-accuracy Geolocation |
63 // subscription. When the last high-accuracy Geolocation unsubscribes | 67 // subscription. When the last high-accuracy Geolocation unsubscribes |
64 // it calls setEnableHighAccuracy(false) after stopUpdating. | 68 // it calls setEnableHighAccuracy(false) after stopUpdating. |
65 bool has_changed = enable_high_accuracy_ != enable_high_accuracy; | 69 bool has_changed = enable_high_accuracy_ != enable_high_accuracy; |
66 enable_high_accuracy_ = enable_high_accuracy; | 70 enable_high_accuracy_ = enable_high_accuracy; |
67 // We have a different accuracy requirement. Request browser to update. | 71 // We have a different accuracy requirement. Request browser to update. |
68 if (updating_ && has_changed) | 72 if (updating_ && has_changed) |
69 startUpdating(); | 73 startUpdating(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 NOTREACHED() << geoposition.error_code; | 152 NOTREACHED() << geoposition.error_code; |
149 return; | 153 return; |
150 } | 154 } |
151 controller_->errorOccurred( | 155 controller_->errorOccurred( |
152 WebGeolocationError( | 156 WebGeolocationError( |
153 code, blink::WebString::fromUTF8(geoposition.error_message))); | 157 code, blink::WebString::fromUTF8(geoposition.error_message))); |
154 } | 158 } |
155 } | 159 } |
156 | 160 |
157 } // namespace content | 161 } // namespace content |
OLD | NEW |