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

Side by Side Diff: content/renderer/geolocation_dispatcher.cc

Issue 185813004: [Geolocation] Attach user gesture indicator to permission request call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch android Created 6 years, 8 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
« no previous file with comments | « content/public/browser/geolocation_permission_context.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/renderer/geolocation_dispatcher.h" 5 #include "content/renderer/geolocation_dispatcher.h"
6 6
7 #include "content/common/geolocation_messages.h" 7 #include "content/common/geolocation_messages.h"
8 #include "content/renderer/render_view_impl.h" 8 #include "content/renderer/render_view_impl.h"
9 #include "third_party/WebKit/public/platform/WebString.h" 9 #include "third_party/WebKit/public/platform/WebString.h"
10 #include "third_party/WebKit/public/web/WebGeolocationPermissionRequest.h" 10 #include "third_party/WebKit/public/web/WebGeolocationPermissionRequest.h"
11 #include "third_party/WebKit/public/web/WebGeolocationPermissionRequestManager.h " 11 #include "third_party/WebKit/public/web/WebGeolocationPermissionRequestManager.h "
12 #include "third_party/WebKit/public/web/WebGeolocationClient.h" 12 #include "third_party/WebKit/public/web/WebGeolocationClient.h"
13 #include "third_party/WebKit/public/web/WebGeolocationPosition.h" 13 #include "third_party/WebKit/public/web/WebGeolocationPosition.h"
14 #include "third_party/WebKit/public/web/WebGeolocationError.h" 14 #include "third_party/WebKit/public/web/WebGeolocationError.h"
15 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
15 16
16 using blink::WebGeolocationController; 17 using blink::WebGeolocationController;
17 using blink::WebGeolocationError; 18 using blink::WebGeolocationError;
18 using blink::WebGeolocationPermissionRequest; 19 using blink::WebGeolocationPermissionRequest;
19 using blink::WebGeolocationPermissionRequestManager; 20 using blink::WebGeolocationPermissionRequestManager;
20 using blink::WebGeolocationPosition; 21 using blink::WebGeolocationPosition;
21 22
22 namespace content { 23 namespace content {
23 24
24 GeolocationDispatcher::GeolocationDispatcher(RenderViewImpl* render_view) 25 GeolocationDispatcher::GeolocationDispatcher(RenderViewImpl* render_view)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return false; 83 return false;
83 } 84 }
84 85
85 // TODO(jknotten): Change the messages to use a security origin, so no 86 // TODO(jknotten): Change the messages to use a security origin, so no
86 // conversion is necessary. 87 // conversion is necessary.
87 void GeolocationDispatcher::requestPermission( 88 void GeolocationDispatcher::requestPermission(
88 const WebGeolocationPermissionRequest& permissionRequest) { 89 const WebGeolocationPermissionRequest& permissionRequest) {
89 int bridge_id = pending_permissions_->add(permissionRequest); 90 int bridge_id = pending_permissions_->add(permissionRequest);
90 base::string16 origin = permissionRequest.securityOrigin().toString(); 91 base::string16 origin = permissionRequest.securityOrigin().toString();
91 Send(new GeolocationHostMsg_RequestPermission( 92 Send(new GeolocationHostMsg_RequestPermission(
92 routing_id(), bridge_id, GURL(origin))); 93 routing_id(), bridge_id, GURL(origin),
94 blink::WebUserGestureIndicator::isProcessingUserGesture()));
93 } 95 }
94 96
95 // TODO(jknotten): Change the messages to use a security origin, so no 97 // TODO(jknotten): Change the messages to use a security origin, so no
96 // conversion is necessary. 98 // conversion is necessary.
97 void GeolocationDispatcher::cancelPermissionRequest( 99 void GeolocationDispatcher::cancelPermissionRequest(
98 const WebGeolocationPermissionRequest& permissionRequest) { 100 const WebGeolocationPermissionRequest& permissionRequest) {
99 int bridge_id; 101 int bridge_id;
100 if (!pending_permissions_->remove(permissionRequest, bridge_id)) 102 if (!pending_permissions_->remove(permissionRequest, bridge_id))
101 return; 103 return;
102 base::string16 origin = permissionRequest.securityOrigin().toString(); 104 base::string16 origin = permissionRequest.securityOrigin().toString();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 NOTREACHED() << geoposition.error_code; 150 NOTREACHED() << geoposition.error_code;
149 return; 151 return;
150 } 152 }
151 controller_->errorOccurred( 153 controller_->errorOccurred(
152 WebGeolocationError( 154 WebGeolocationError(
153 code, blink::WebString::fromUTF8(geoposition.error_message))); 155 code, blink::WebString::fromUTF8(geoposition.error_message)));
154 } 156 }
155 } 157 }
156 158
157 } // namespace content 159 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/geolocation_permission_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698