| 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 "chrome/browser/geolocation/chrome_geolocation_permission_context_andro
id.h" | 5 #include "chrome/browser/geolocation/chrome_geolocation_permission_context_andro
id.h" |
| 6 | 6 |
| 7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 11 | 11 |
| 12 ChromeGeolocationPermissionContextAndroid:: | 12 ChromeGeolocationPermissionContextAndroid:: |
| 13 ChromeGeolocationPermissionContextAndroid(Profile* profile) | 13 ChromeGeolocationPermissionContextAndroid(Profile* profile) |
| 14 : ChromeGeolocationPermissionContext(profile) { | 14 : ChromeGeolocationPermissionContext(profile) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 ChromeGeolocationPermissionContextAndroid:: | 17 ChromeGeolocationPermissionContextAndroid:: |
| 18 ~ChromeGeolocationPermissionContextAndroid() { | 18 ~ChromeGeolocationPermissionContextAndroid() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 void ChromeGeolocationPermissionContextAndroid::DecidePermission( | 21 void ChromeGeolocationPermissionContextAndroid::DecidePermission( |
| 22 int render_process_id, | 22 const content::GeolocationPermissionRequestID& id, |
| 23 int render_view_id, | |
| 24 int bridge_id, | |
| 25 const GURL& requesting_frame, | 23 const GURL& requesting_frame, |
| 26 const GURL& embedder, | 24 const GURL& embedder, |
| 27 base::Callback<void(bool)> callback) { | 25 base::Callback<void(bool)> callback) { |
| 28 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 26 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 29 | 27 |
| 30 // Check to see if the feature in its entirety has been disabled. | 28 // Check to see if the feature in its entirety has been disabled. |
| 31 // This must happen before other services (e.g. tabs, extensions) | 29 // This must happen before other services (e.g. tabs, extensions) |
| 32 // get an opportunity to allow the geolocation request. | 30 // get an opportunity to allow the geolocation request. |
| 33 if (!profile()->GetPrefs()->GetBoolean(prefs::kGeolocationEnabled)) { | 31 if (!profile()->GetPrefs()->GetBoolean(prefs::kGeolocationEnabled)) { |
| 34 PermissionDecided(render_process_id, render_view_id, bridge_id, | 32 PermissionDecided(id, requesting_frame, embedder, callback, false); |
| 35 requesting_frame, embedder, callback, false); | |
| 36 return; | 33 return; |
| 37 } | 34 } |
| 38 | 35 |
| 39 ChromeGeolocationPermissionContext::DecidePermission( | 36 ChromeGeolocationPermissionContext::DecidePermission(id, requesting_frame, |
| 40 render_process_id, render_view_id, bridge_id, | 37 embedder, callback); |
| 41 requesting_frame, embedder, callback); | |
| 42 } | 38 } |
| OLD | NEW |