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

Side by Side Diff: android_webview/native/aw_geolocation_permission_context.cc

Issue 330143002: Simplify geolocation permission request in the Content API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 "android_webview/native/aw_geolocation_permission_context.h"
6
7 #include "android_webview/native/aw_contents.h"
8 #include "base/bind.h"
9 #include "base/callback.h"
10 #include "content/public/browser/browser_thread.h"
11 #include "content/public/browser/render_view_host.h"
12 #include "content/public/browser/web_contents.h"
13
14 namespace android_webview {
15
16 AwGeolocationPermissionContext::~AwGeolocationPermissionContext() {
17 }
18
19 void AwGeolocationPermissionContext::RequestGeolocationPermission(
20 content::WebContents* web_contents,
21 int bridge_id,
22 const GURL& requesting_frame,
23 bool user_gesture,
24 base::Callback<void(bool)> callback) {
25 AwContents* aw_contents = AwContents::FromWebContents(web_contents);
26 if (!aw_contents) {
27 callback.Run(false);
28 return;
29 }
30 aw_contents->ShowGeolocationPrompt(requesting_frame, callback);
31 }
32
33 // static
34 content::GeolocationPermissionContext*
35 AwGeolocationPermissionContext::Create(AwBrowserContext* browser_context) {
36 return new AwGeolocationPermissionContext();
37 }
38
39 void AwGeolocationPermissionContext::CancelGeolocationPermissionRequest(
40 content::WebContents* web_contents,
41 int bridge_id,
42 const GURL& requesting_frame) {
43 AwContents* aw_contents = AwContents::FromWebContents(web_contents);
44 if (aw_contents) {
45 aw_contents->HideGeolocationPrompt(requesting_frame);
46 }
47 }
48
49 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_geolocation_permission_context.h ('k') | android_webview/native/webview_native.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698