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

Side by Side Diff: android_webview/browser/aw_permission_manager.cc

Issue 2110343002: Reintroduce plumbing for user gesture into permission system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "android_webview/browser/aw_permission_manager.h" 5 #include "android_webview/browser/aw_permission_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 weak_ptr_factory_(this) { 162 weak_ptr_factory_(this) {
163 } 163 }
164 164
165 AwPermissionManager::~AwPermissionManager() { 165 AwPermissionManager::~AwPermissionManager() {
166 } 166 }
167 167
168 int AwPermissionManager::RequestPermission( 168 int AwPermissionManager::RequestPermission(
169 PermissionType permission, 169 PermissionType permission,
170 content::RenderFrameHost* render_frame_host, 170 content::RenderFrameHost* render_frame_host,
171 const GURL& requesting_origin, 171 const GURL& requesting_origin,
172 bool user_gesture,
172 const base::Callback<void(PermissionStatus)>& callback) { 173 const base::Callback<void(PermissionStatus)>& callback) {
173 int render_process_id = render_frame_host->GetProcess()->GetID(); 174 int render_process_id = render_frame_host->GetProcess()->GetID();
174 int render_frame_id = render_frame_host->GetRoutingID(); 175 int render_frame_id = render_frame_host->GetRoutingID();
175 AwBrowserPermissionRequestDelegate* delegate = 176 AwBrowserPermissionRequestDelegate* delegate =
176 AwBrowserPermissionRequestDelegate::FromID(render_process_id, 177 AwBrowserPermissionRequestDelegate::FromID(render_process_id,
177 render_frame_id); 178 render_frame_id);
178 if (!delegate) { 179 if (!delegate) {
179 DVLOG(0) << "Dropping permission request for " 180 DVLOG(0) << "Dropping permission request for "
180 << static_cast<int>(permission); 181 << static_cast<int>(permission);
181 callback.Run(PermissionStatus::DENIED); 182 callback.Run(PermissionStatus::DENIED);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 callback.Run(PermissionStatus::DENIED); 256 callback.Run(PermissionStatus::DENIED);
256 break; 257 break;
257 } 258 }
258 return request_id; 259 return request_id;
259 } 260 }
260 261
261 int AwPermissionManager::RequestPermissions( 262 int AwPermissionManager::RequestPermissions(
262 const std::vector<PermissionType>& permissions, 263 const std::vector<PermissionType>& permissions,
263 content::RenderFrameHost* render_frame_host, 264 content::RenderFrameHost* render_frame_host,
264 const GURL& requesting_origin, 265 const GURL& requesting_origin,
266 bool user_gesture,
265 const base::Callback<void( 267 const base::Callback<void(
266 const std::vector<PermissionStatus>&)>& callback) { 268 const std::vector<PermissionStatus>&)>& callback) {
267 NOTIMPLEMENTED() << "RequestPermissions has not been implemented in WebView"; 269 NOTIMPLEMENTED() << "RequestPermissions has not been implemented in WebView";
268 270
269 std::vector<PermissionStatus> result(permissions.size()); 271 std::vector<PermissionStatus> result(permissions.size());
270 const GURL& embedding_origin = 272 const GURL& embedding_origin =
271 content::WebContents::FromRenderFrameHost(render_frame_host) 273 content::WebContents::FromRenderFrameHost(render_frame_host)
272 ->GetLastCommittedURL().GetOrigin(); 274 ->GetLastCommittedURL().GetOrigin();
273 275
274 for (PermissionType type : permissions) { 276 for (PermissionType type : permissions) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 const GURL& embedding_origin, 411 const GURL& embedding_origin,
410 const base::Callback<void(PermissionStatus)>& callback) { 412 const base::Callback<void(PermissionStatus)>& callback) {
411 return kNoPendingOperation; 413 return kNoPendingOperation;
412 } 414 }
413 415
414 void AwPermissionManager::UnsubscribePermissionStatusChange( 416 void AwPermissionManager::UnsubscribePermissionStatusChange(
415 int subscription_id) { 417 int subscription_id) {
416 } 418 }
417 419
418 } // namespace android_webview 420 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_permission_manager.h ('k') | blimp/engine/app/blimp_permission_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698