| 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/browser/geolocation/geolocation_dispatcher_host.h" | 5 #include "content/browser/geolocation/geolocation_dispatcher_host.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "content/browser/geolocation/geolocation_provider_impl.h" | 13 #include "content/browser/geolocation/geolocation_provider_impl.h" |
| 14 #include "content/browser/renderer_host/render_message_filter.h" | 14 #include "content/browser/renderer_host/render_message_filter.h" |
| 15 #include "content/browser/renderer_host/render_process_host_impl.h" | 15 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 16 #include "content/browser/renderer_host/render_view_host_impl.h" | 16 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 17 #include "content/public/browser/geolocation_permission_context.h" | 17 #include "content/public/browser/geolocation_permission_context.h" |
| 18 #include "content/public/common/geoposition.h" | 18 #include "content/public/common/geoposition.h" |
| 19 #include "content/common/geolocation_messages.h" | 19 #include "content/common/geolocation_messages.h" |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 const uint32 kFilteredMessageClasses[] = { |
| 25 GeolocationMsgStart, |
| 26 }; |
| 27 |
| 24 void NotifyGeolocationProviderPermissionGranted() { | 28 void NotifyGeolocationProviderPermissionGranted() { |
| 25 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 29 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 26 GeolocationProviderImpl::GetInstance()->UserDidOptIntoLocationServices(); | 30 GeolocationProviderImpl::GetInstance()->UserDidOptIntoLocationServices(); |
| 27 } | 31 } |
| 28 | 32 |
| 29 void SendGeolocationPermissionResponse(int render_process_id, | 33 void SendGeolocationPermissionResponse(int render_process_id, |
| 30 int render_view_id, | 34 int render_view_id, |
| 31 int bridge_id, | 35 int bridge_id, |
| 32 bool allowed) { | 36 bool allowed) { |
| 33 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 37 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 292 |
| 289 // static | 293 // static |
| 290 GeolocationDispatcherHost* GeolocationDispatcherHost::New( | 294 GeolocationDispatcherHost* GeolocationDispatcherHost::New( |
| 291 int render_process_id, | 295 int render_process_id, |
| 292 GeolocationPermissionContext* geolocation_permission_context) { | 296 GeolocationPermissionContext* geolocation_permission_context) { |
| 293 return new GeolocationDispatcherHostImpl( | 297 return new GeolocationDispatcherHostImpl( |
| 294 render_process_id, | 298 render_process_id, |
| 295 geolocation_permission_context); | 299 geolocation_permission_context); |
| 296 } | 300 } |
| 297 | 301 |
| 298 GeolocationDispatcherHost::GeolocationDispatcherHost() { | 302 GeolocationDispatcherHost::GeolocationDispatcherHost() |
| 299 } | 303 : BrowserMessageFilter( |
| 304 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)) {} |
| 300 | 305 |
| 301 GeolocationDispatcherHost::~GeolocationDispatcherHost() { | 306 GeolocationDispatcherHost::~GeolocationDispatcherHost() { |
| 302 } | 307 } |
| 303 | 308 |
| 304 } // namespace content | 309 } // namespace content |
| OLD | NEW |