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 "content/shell/browser/layout_test/layout_test_permission_manager.h" | 5 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return hash; | 54 return hash; |
55 } | 55 } |
56 | 56 |
57 LayoutTestPermissionManager::LayoutTestPermissionManager() | 57 LayoutTestPermissionManager::LayoutTestPermissionManager() |
58 : PermissionManager() { | 58 : PermissionManager() { |
59 } | 59 } |
60 | 60 |
61 LayoutTestPermissionManager::~LayoutTestPermissionManager() { | 61 LayoutTestPermissionManager::~LayoutTestPermissionManager() { |
62 } | 62 } |
63 | 63 |
64 void LayoutTestPermissionManager::RequestPermission( | 64 int LayoutTestPermissionManager::RequestPermission( |
65 PermissionType permission, | 65 PermissionType permission, |
66 RenderFrameHost* render_frame_host, | 66 RenderFrameHost* render_frame_host, |
67 int request_id, | |
68 const GURL& requesting_origin, | 67 const GURL& requesting_origin, |
69 bool user_gesture, | 68 bool user_gesture, |
70 const base::Callback<void(PermissionStatus)>& callback) { | 69 const base::Callback<void(PermissionStatus)>& callback) { |
71 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 70 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
72 | 71 |
73 callback.Run(GetPermissionStatus( | 72 callback.Run(GetPermissionStatus( |
74 permission, requesting_origin, | 73 permission, requesting_origin, |
75 WebContents::FromRenderFrameHost(render_frame_host) | 74 WebContents::FromRenderFrameHost(render_frame_host) |
76 ->GetLastCommittedURL().GetOrigin())); | 75 ->GetLastCommittedURL().GetOrigin())); |
| 76 return kNoPendingOperation; |
77 } | 77 } |
78 | 78 |
79 void LayoutTestPermissionManager::CancelPermissionRequest( | 79 void LayoutTestPermissionManager::CancelPermissionRequest( |
80 PermissionType permission, | 80 PermissionType permission, |
81 RenderFrameHost* render_frame_host, | 81 RenderFrameHost* render_frame_host, |
82 int request_id, | 82 int request_id, |
83 const GURL& requesting_origin) { | 83 const GURL& requesting_origin) { |
84 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 84 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
85 } | 85 } |
86 | 86 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Add the callback to |callbacks| which will be run after the loop to | 196 // Add the callback to |callbacks| which will be run after the loop to |
197 // prevent re-entrance issues. | 197 // prevent re-entrance issues. |
198 callbacks.push_back(base::Bind(subscription->callback, status)); | 198 callbacks.push_back(base::Bind(subscription->callback, status)); |
199 } | 199 } |
200 | 200 |
201 for (const auto& callback : callbacks) | 201 for (const auto& callback : callbacks) |
202 callback.Run(); | 202 callback.Run(); |
203 } | 203 } |
204 | 204 |
205 } // namespace content | 205 } // namespace content |
OLD | NEW |