| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 content::WebContents* web_contents = | 65 content::WebContents* web_contents = |
| 66 tab_util::GetWebContentsByID(render_process_id, render_view_id); | 66 tab_util::GetWebContentsByID(render_process_id, render_view_id); |
| 67 const GeolocationPermissionRequestID id(render_process_id, render_view_id, | 67 const GeolocationPermissionRequestID id(render_process_id, render_view_id, |
| 68 bridge_id); | 68 bridge_id); |
| 69 ExtensionService* extension_service = | 69 ExtensionService* extension_service = |
| 70 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 70 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 71 if (extension_service) { | 71 if (extension_service) { |
| 72 const extensions::Extension* extension = | 72 const extensions::Extension* extension = |
| 73 extension_service->extensions()->GetExtensionOrAppByURL( | 73 extension_service->extensions()->GetExtensionOrAppByURL( |
| 74 ExtensionURLInfo(WebKit::WebSecurityOrigin::createFromString( | 74 requesting_frame); |
| 75 UTF8ToUTF16(requesting_frame.spec())), | |
| 76 requesting_frame)); | |
| 77 if (IsExtensionWithPermissionOrSuggestInConsole(APIPermission::kGeolocation, | 75 if (IsExtensionWithPermissionOrSuggestInConsole(APIPermission::kGeolocation, |
| 78 extension, | 76 extension, |
| 79 profile_)) { | 77 profile_)) { |
| 80 // Make sure the extension is in the calling process. | 78 // Make sure the extension is in the calling process. |
| 81 if (extension_service->process_map()->Contains(extension->id(), | 79 if (extension_service->process_map()->Contains(extension->id(), |
| 82 id.render_process_id())) { | 80 id.render_process_id())) { |
| 83 NotifyPermissionSet(id, requesting_frame, callback, true); | 81 NotifyPermissionSet(id, requesting_frame, callback, true); |
| 84 return; | 82 return; |
| 85 } | 83 } |
| 86 } | 84 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 base::Bind( | 202 base::Bind( |
| 205 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 203 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
| 206 this, id)); | 204 this, id)); |
| 207 return; | 205 return; |
| 208 } | 206 } |
| 209 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 207 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 210 if (shutting_down_) | 208 if (shutting_down_) |
| 211 return; | 209 return; |
| 212 QueueController()->CancelInfoBarRequest(id); | 210 QueueController()->CancelInfoBarRequest(id); |
| 213 } | 211 } |
| OLD | NEW |