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