Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: chrome/browser/geolocation/chrome_geolocation_permission_context.cc

Issue 8827013: Move/replace/rename URL-based extension getters from ExtensionService to/in ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: id Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_webstore_private_api.cc ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/chrome_geolocation_permission_context.cc
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
index 4be6d372d68490c9fe7e1bf90a8eca2397f371c9..5bc344e7e21197cf4c8561fce0eb8e22bfb12fbd 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context.cc
@@ -35,10 +35,12 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "net/base/net_util.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
+using WebKit::WebSecurityOrigin;
// GeolocationInfoBarQueueController ------------------------------------------
@@ -551,14 +553,19 @@ void ChromeGeolocationPermissionContext::RequestGeolocationPermission(
}
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- ExtensionService* extensions = profile_->GetExtensionService();
- if (extensions) {
- const Extension* ext = extensions->GetExtensionByURL(requesting_frame);
- if (!ext)
- ext = extensions->GetExtensionByWebExtent(requesting_frame);
- if (ext && ext->HasAPIPermission(ExtensionAPIPermission::kGeolocation)) {
+ ExtensionService* extension_service = profile_->GetExtensionService();
+ if (extension_service) {
+ const Extension* extension =
+ extension_service->extensions()->GetExtensionOrAppByURL(
+ ExtensionURLInfo(
+ WebSecurityOrigin::createFromString(
+ UTF8ToUTF16(requesting_frame.spec())),
+ requesting_frame));
+ if (extension &&
+ extension->HasAPIPermission(ExtensionAPIPermission::kGeolocation)) {
// Make sure the extension is in the calling process.
- if (extensions->process_map()->Contains(ext->id(), render_process_id)) {
+ if (extension_service->process_map()->Contains(
+ extension->id(), render_process_id)) {
NotifyPermissionSet(render_process_id, render_view_id, bridge_id,
requesting_frame, callback, true);
return;
« no previous file with comments | « chrome/browser/extensions/extension_webstore_private_api.cc ('k') | chrome/browser/memory_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698