Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <memory> | |
| 7 #include <string> | 8 #include <string> |
| 8 | 9 |
| 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" | 10 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "content/public/browser/permission_type.h" | 14 #include "content/public/browser/permission_type.h" |
| 14 #include "content/public/browser/render_frame_host.h" | 15 #include "content/public/browser/render_frame_host.h" |
| 15 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 pending_request->SetPermissionStatus( | 269 pending_request->SetPermissionStatus( |
| 269 permissions[i], | 270 permissions[i], |
| 270 it.GetCurrentValue()->GetPermissionStatus(permissions[i])); | 271 it.GetCurrentValue()->GetPermissionStatus(permissions[i])); |
| 271 } | 272 } |
| 272 should_delegate_requests[i] = false; | 273 should_delegate_requests[i] = false; |
| 273 break; | 274 break; |
| 274 } | 275 } |
| 275 } | 276 } |
| 276 } | 277 } |
| 277 | 278 |
| 278 int request_id = pending_requests_.Add(pending_request); | 279 int request_id = pending_requests_.Add( |
| 280 std::unique_ptr<PendingRequest>(pending_request)); | |
|
danakj
2016/11/18 00:15:32
base::WrapUnique?
Tho it'd be nicer to allocate i
| |
| 279 | 281 |
| 280 AwBrowserPermissionRequestDelegate* delegate = GetDelegate( | 282 AwBrowserPermissionRequestDelegate* delegate = GetDelegate( |
| 281 pending_request->render_process_id, pending_request->render_frame_id); | 283 pending_request->render_process_id, pending_request->render_frame_id); |
| 282 | 284 |
| 283 for (size_t i = 0; i < permissions.size(); ++i) { | 285 for (size_t i = 0; i < permissions.size(); ++i) { |
| 284 if (!should_delegate_requests[i]) | 286 if (!should_delegate_requests[i]) |
| 285 continue; | 287 continue; |
| 286 | 288 |
| 287 if (!delegate) { | 289 if (!delegate) { |
| 288 DVLOG(0) << "Dropping permissions request for " | 290 DVLOG(0) << "Dropping permissions request for " |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 542 ->GetLastCommittedURL().GetOrigin(); | 544 ->GetLastCommittedURL().GetOrigin(); |
| 543 } | 545 } |
| 544 | 546 |
| 545 AwBrowserPermissionRequestDelegate* AwPermissionManager::GetDelegate( | 547 AwBrowserPermissionRequestDelegate* AwPermissionManager::GetDelegate( |
| 546 int render_process_id, int render_frame_id) { | 548 int render_process_id, int render_frame_id) { |
| 547 return AwBrowserPermissionRequestDelegate::FromID(render_process_id, | 549 return AwBrowserPermissionRequestDelegate::FromID(render_process_id, |
| 548 render_frame_id); | 550 render_frame_id); |
| 549 } | 551 } |
| 550 | 552 |
| 551 } // namespace android_webview | 553 } // namespace android_webview |
| OLD | NEW |