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 "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 -1; | |
|
mlamouri (slow - plz ping)
2015/09/16 14:42:57
return PermissionManager::CONSTANT
Lalit Maganti
2015/09/16 16:41:10
Done.
| |
| 77 } | 77 } |
| 78 | 78 |
| 79 void LayoutTestPermissionManager::CancelPermissionRequest( | 79 void LayoutTestPermissionManager::CancelPermissionRequest(int request_id) { |
| 80 PermissionType permission, | |
| 81 RenderFrameHost* render_frame_host, | |
| 82 int request_id, | |
| 83 const GURL& requesting_origin) { | |
| 84 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 80 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 85 } | 81 } |
| 86 | 82 |
| 87 void LayoutTestPermissionManager::ResetPermission( | 83 void LayoutTestPermissionManager::ResetPermission( |
| 88 PermissionType permission, | 84 PermissionType permission, |
| 89 const GURL& requesting_origin, | 85 const GURL& requesting_origin, |
| 90 const GURL& embedding_origin) { | 86 const GURL& embedding_origin) { |
| 91 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 87 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 92 | 88 |
| 93 base::AutoLock lock(permissions_lock_); | 89 base::AutoLock lock(permissions_lock_); |
| (...skipping 102 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 | 192 // Add the callback to |callbacks| which will be run after the loop to |
| 197 // prevent re-entrance issues. | 193 // prevent re-entrance issues. |
| 198 callbacks.push_back(base::Bind(subscription->callback, status)); | 194 callbacks.push_back(base::Bind(subscription->callback, status)); |
| 199 } | 195 } |
| 200 | 196 |
| 201 for (const auto& callback : callbacks) | 197 for (const auto& callback : callbacks) |
| 202 callback.Run(); | 198 callback.Run(); |
| 203 } | 199 } |
| 204 | 200 |
| 205 } // namespace content | 201 } // namespace content |
| OLD | NEW |