| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/geolocation/geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/permissions/permission_request_id.h" | 9 #include "chrome/browser/permissions/permission_request_id.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/permission_type.h" | |
| 13 #include "content/public/browser/render_frame_host.h" | 12 #include "content/public/browser/render_frame_host.h" |
| 14 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 15 #include "device/geolocation/geolocation_provider.h" | 14 #include "device/geolocation/geolocation_provider.h" |
| 16 #include "url/origin.h" | 15 #include "url/origin.h" |
| 17 | 16 |
| 18 GeolocationPermissionContext::GeolocationPermissionContext(Profile* profile) | 17 GeolocationPermissionContext::GeolocationPermissionContext(Profile* profile) |
| 19 : PermissionContextBase(profile, | 18 : PermissionContextBase(profile, |
| 20 content::PermissionType::GEOLOCATION, | |
| 21 CONTENT_SETTINGS_TYPE_GEOLOCATION), | 19 CONTENT_SETTINGS_TYPE_GEOLOCATION), |
| 22 extensions_context_(profile) {} | 20 extensions_context_(profile) {} |
| 23 | 21 |
| 24 GeolocationPermissionContext::~GeolocationPermissionContext() { | 22 GeolocationPermissionContext::~GeolocationPermissionContext() { |
| 25 } | 23 } |
| 26 | 24 |
| 27 void GeolocationPermissionContext::DecidePermission( | 25 void GeolocationPermissionContext::DecidePermission( |
| 28 content::WebContents* web_contents, | 26 content::WebContents* web_contents, |
| 29 const PermissionRequestID& id, | 27 const PermissionRequestID& id, |
| 30 const GURL& requesting_origin, | 28 const GURL& requesting_origin, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 83 |
| 86 if (allowed) { | 84 if (allowed) { |
| 87 device::GeolocationProvider::GetInstance() | 85 device::GeolocationProvider::GetInstance() |
| 88 ->UserDidOptIntoLocationServices(); | 86 ->UserDidOptIntoLocationServices(); |
| 89 } | 87 } |
| 90 } | 88 } |
| 91 | 89 |
| 92 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const { | 90 bool GeolocationPermissionContext::IsRestrictedToSecureOrigins() const { |
| 93 return true; | 91 return true; |
| 94 } | 92 } |
| OLD | NEW |