| 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/shell_permission_manager.h" | 5 #include "content/shell/browser/shell_permission_manager.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "content/public/browser/permission_type.h" | 9 #include "content/public/browser/permission_type.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 return kNoPendingOperation; | 40 return kNoPendingOperation; |
| 41 } | 41 } |
| 42 | 42 |
| 43 int ShellPermissionManager::RequestPermissions( | 43 int ShellPermissionManager::RequestPermissions( |
| 44 const std::vector<PermissionType>& permissions, | 44 const std::vector<PermissionType>& permissions, |
| 45 content::RenderFrameHost* render_frame_host, | 45 content::RenderFrameHost* render_frame_host, |
| 46 const GURL& requesting_origin, | 46 const GURL& requesting_origin, |
| 47 bool user_gesture, | 47 bool user_gesture, |
| 48 const base::Callback< | 48 const base::Callback< |
| 49 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) { | 49 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) { |
| 50 std::vector<blink::mojom::PermissionStatus> result(permissions.size()); | 50 std::vector<blink::mojom::PermissionStatus> result; |
| 51 for (const auto& permission : permissions) { | 51 for (const auto& permission : permissions) { |
| 52 result.push_back(IsWhitelistedPermissionType(permission) | 52 result.push_back(IsWhitelistedPermissionType(permission) |
| 53 ? blink::mojom::PermissionStatus::GRANTED | 53 ? blink::mojom::PermissionStatus::GRANTED |
| 54 : blink::mojom::PermissionStatus::DENIED); | 54 : blink::mojom::PermissionStatus::DENIED); |
| 55 } | 55 } |
| 56 callback.Run(result); | 56 callback.Run(result); |
| 57 return kNoPendingOperation; | 57 return kNoPendingOperation; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ShellPermissionManager::CancelPermissionRequest(int request_id) { | 60 void ShellPermissionManager::CancelPermissionRequest(int request_id) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const GURL& embedding_origin, | 92 const GURL& embedding_origin, |
| 93 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { | 93 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { |
| 94 return kNoPendingOperation; | 94 return kNoPendingOperation; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void ShellPermissionManager::UnsubscribePermissionStatusChange( | 97 void ShellPermissionManager::UnsubscribePermissionStatusChange( |
| 98 int subscription_id) { | 98 int subscription_id) { |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace content | 101 } // namespace content |
| OLD | NEW |