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

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

Issue 11188020: Introduce Android variants of ChromeGeolocationPermissionContext, GeolocationConfirmInfoBarDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build error Created 8 years, 2 months 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
Index: chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..18906d17f7222cc9bcfbcec7dbad7a72b96ff55e
--- /dev/null
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_android.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/geolocation/chrome_geolocation_permission_context_android.h"
+
+#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/pref_names.h"
+#include "content/public/browser/browser_thread.h"
+
+ChromeGeolocationPermissionContextAndroid::
+ChromeGeolocationPermissionContextAndroid(Profile* profile)
+ : ChromeGeolocationPermissionContext(profile) {
+}
+
+void ChromeGeolocationPermissionContextAndroid::DecidePermission(
+ int render_process_id,
+ int render_view_id,
+ int bridge_id,
+ const GURL& requesting_frame,
+ const GURL& embedder,
+ base::Callback<void(bool)> callback) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
+
+ // Check to see if the feature in its entirety has been disabled.
+ // This must happen before other services (e.g. tabs, extensions)
+ // get an opportunity to allow the geolocation request.
+ if (!profile()->GetPrefs()->GetBoolean(prefs::kGeolocationEnabled)) {
+ PermissionDecided(render_process_id, render_view_id, bridge_id,
+ requesting_frame, embedder, callback, false);
+ return;
+ }
+
+ ChromeGeolocationPermissionContext::DecidePermission(
+ render_process_id, render_view_id, bridge_id,
+ requesting_frame, embedder, callback);
+}

Powered by Google App Engine
This is Rietveld 408576698