Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/browser/geolocation/geolocation_dispatcher_host_old.h" | 5 #include "chrome/browser/geolocation/geolocation_dispatcher_host_old.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 geolocation_permission_context_->CancelGeolocationPermissionRequest( | 164 geolocation_permission_context_->CancelGeolocationPermissionRequest( |
| 165 resource_message_filter_process_id_, render_view_id, bridge_id, | 165 resource_message_filter_process_id_, render_view_id, bridge_id, |
| 166 requesting_frame); | 166 requesting_frame); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void GeolocationDispatcherHostOldImpl::OnStartUpdating( | 169 void GeolocationDispatcherHostOldImpl::OnStartUpdating( |
| 170 int render_view_id, | 170 int render_view_id, |
| 171 int bridge_id, | 171 int bridge_id, |
| 172 const GURL& requesting_frame, | 172 const GURL& requesting_frame, |
| 173 bool enable_high_accuracy) { | 173 bool enable_high_accuracy) { |
| 174 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) | |
|
joth
2010/12/07 10:24:51
just to check, in the gypi you have set ENABLE_CLI
John Knottenbelt
2010/12/07 12:30:04
No, see comments in chrome_browser.gypi
| |
| 175 OnRegisterDispatcher(render_view_id); | |
| 176 #endif | |
| 174 // WebKit sends the startupdating request before checking permissions, to | 177 // WebKit sends the startupdating request before checking permissions, to |
| 175 // optimize the no-location-available case and reduce latency in the success | 178 // optimize the no-location-available case and reduce latency in the success |
| 176 // case (location lookup happens in parallel with the permission request). | 179 // case (location lookup happens in parallel with the permission request). |
| 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 180 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 178 DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" | 181 DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" |
| 179 << render_view_id << ":" << bridge_id; | 182 << render_view_id << ":" << bridge_id; |
| 180 bridge_update_options_[std::make_pair(render_view_id, bridge_id)] = | 183 bridge_update_options_[std::make_pair(render_view_id, bridge_id)] = |
| 181 GeolocationObserverOptions(enable_high_accuracy); | 184 GeolocationObserverOptions(enable_high_accuracy); |
| 182 geolocation_permission_context_->StartUpdatingRequested( | 185 geolocation_permission_context_->StartUpdatingRequested( |
| 183 resource_message_filter_process_id_, render_view_id, bridge_id, | 186 resource_message_filter_process_id_, render_view_id, bridge_id, |
| 184 requesting_frame); | 187 requesting_frame); |
| 185 RefreshGeolocationObserverOptions(); | 188 RefreshGeolocationObserverOptions(); |
| 186 } | 189 } |
| 187 | 190 |
| 188 void GeolocationDispatcherHostOldImpl::OnStopUpdating(int render_view_id, | 191 void GeolocationDispatcherHostOldImpl::OnStopUpdating(int render_view_id, |
| 189 int bridge_id) { | 192 int bridge_id) { |
| 190 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 191 DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" | 194 DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" |
| 192 << render_view_id << ":" << bridge_id; | 195 << render_view_id << ":" << bridge_id; |
| 193 if (bridge_update_options_.erase(std::make_pair(render_view_id, bridge_id))) | 196 if (bridge_update_options_.erase(std::make_pair(render_view_id, bridge_id))) |
| 194 RefreshGeolocationObserverOptions(); | 197 RefreshGeolocationObserverOptions(); |
| 195 geolocation_permission_context_->StopUpdatingRequested( | 198 geolocation_permission_context_->StopUpdatingRequested( |
| 196 resource_message_filter_process_id_, render_view_id, bridge_id); | 199 resource_message_filter_process_id_, render_view_id, bridge_id); |
| 200 #if defined(ENABLE_CLIENT_BASED_GEOLOCATION) | |
| 201 OnUnregisterDispatcher(render_view_id); | |
| 202 #endif | |
| 197 } | 203 } |
| 198 | 204 |
| 199 void GeolocationDispatcherHostOldImpl::OnSuspend(int render_view_id, | 205 void GeolocationDispatcherHostOldImpl::OnSuspend(int render_view_id, |
| 200 int bridge_id) { | 206 int bridge_id) { |
| 201 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 207 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 202 DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" | 208 DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" |
| 203 << render_view_id << ":" << bridge_id; | 209 << render_view_id << ":" << bridge_id; |
| 204 // TODO(bulach): connect this with GeolocationArbitrator. | 210 // TODO(bulach): connect this with GeolocationArbitrator. |
| 205 } | 211 } |
| 206 | 212 |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 230 } | 236 } |
| 231 } // namespace | 237 } // namespace |
| 232 | 238 |
| 233 GeolocationDispatcherHostOld* GeolocationDispatcherHostOld::New( | 239 GeolocationDispatcherHostOld* GeolocationDispatcherHostOld::New( |
| 234 int resource_message_filter_process_id, | 240 int resource_message_filter_process_id, |
| 235 GeolocationPermissionContext* geolocation_permission_context) { | 241 GeolocationPermissionContext* geolocation_permission_context) { |
| 236 return new GeolocationDispatcherHostOldImpl( | 242 return new GeolocationDispatcherHostOldImpl( |
| 237 resource_message_filter_process_id, | 243 resource_message_filter_process_id, |
| 238 geolocation_permission_context); | 244 geolocation_permission_context); |
| 239 } | 245 } |
| OLD | NEW |