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.h" | 5 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
6 | 6 |
7 #include <functional> | 7 #include <functional> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 const GURL& requesting_frame) { | 88 const GURL& requesting_frame) { |
89 CancelPendingInfoBarRequest(render_process_id, render_view_id, bridge_id); | 89 CancelPendingInfoBarRequest(render_process_id, render_view_id, bridge_id); |
90 } | 90 } |
91 | 91 |
92 void ChromeGeolocationPermissionContext::DecidePermission( | 92 void ChromeGeolocationPermissionContext::DecidePermission( |
93 int render_process_id, int render_view_id, int bridge_id, | 93 int render_process_id, int render_view_id, int bridge_id, |
94 const GURL& requesting_frame, const GURL& embedder, | 94 const GURL& requesting_frame, const GURL& embedder, |
95 base::Callback<void(bool)> callback) { | 95 base::Callback<void(bool)> callback) { |
96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
97 | 97 |
98 #if defined(OS_ANDROID) | |
John Knottenbelt
2012/10/23 13:10:05
Remove this diff as the code is already in ChromeG
Ramya
2012/10/23 21:57:14
Done.
| |
99 // Check to see if the feature in its entirety has been disabled. | |
100 // This must happen before other services (e.g. tabs, extensions) | |
101 // get an opportunity to allow the geolocation request. | |
102 if (!profile()->GetPrefs()->GetBoolean(prefs::kGeolocationEnabled)) { | |
103 PermissionDecided(render_process_id, render_view_id, bridge_id, | |
104 requesting_frame, embedder, callback, false); | |
105 return; | |
106 } | |
107 #endif | |
108 | |
98 ExtensionService* extension_service = profile_->GetExtensionService(); | 109 ExtensionService* extension_service = profile_->GetExtensionService(); |
99 if (extension_service) { | 110 if (extension_service) { |
100 const extensions::Extension* extension = | 111 const extensions::Extension* extension = |
101 extension_service->extensions()->GetExtensionOrAppByURL( | 112 extension_service->extensions()->GetExtensionOrAppByURL( |
102 ExtensionURLInfo( | 113 ExtensionURLInfo( |
103 WebSecurityOrigin::createFromString( | 114 WebSecurityOrigin::createFromString( |
104 UTF8ToUTF16(requesting_frame.spec())), | 115 UTF8ToUTF16(requesting_frame.spec())), |
105 requesting_frame)); | 116 requesting_frame)); |
106 if (extension && | 117 if (extension && |
107 extension->HasAPIPermission(extensions::APIPermission::kGeolocation)) { | 118 extension->HasAPIPermission(extensions::APIPermission::kGeolocation)) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 210 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
200 this, render_process_id, render_view_id, bridge_id)); | 211 this, render_process_id, render_view_id, bridge_id)); |
201 return; | 212 return; |
202 } | 213 } |
203 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 214 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
204 QueueController()->CancelInfoBarRequest( | 215 QueueController()->CancelInfoBarRequest( |
205 render_process_id, | 216 render_process_id, |
206 render_view_id, | 217 render_view_id, |
207 bridge_id); | 218 bridge_id); |
208 } | 219 } |
OLD | NEW |