| 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 #ifndef CONTENT_SHELL_BROWSER_SHELL_PERMISSION_MANAGER_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_PERMISSION_MANAGER_H_ |
| 6 #define CONTENT_SHELL_BROWSER_SHELL_PERMISSION_MANAGER_H_ | 6 #define CONTENT_SHELL_BROWSER_SHELL_PERMISSION_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/public/browser/permission_manager.h" | 10 #include "content/public/browser/permission_manager.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class ShellPermissionManager : public PermissionManager { | 14 class ShellPermissionManager : public PermissionManager { |
| 15 public: | 15 public: |
| 16 ShellPermissionManager(); | 16 ShellPermissionManager(); |
| 17 ~ShellPermissionManager() override; | 17 ~ShellPermissionManager() override; |
| 18 | 18 |
| 19 // PermissionManager implementation. | 19 // PermissionManager implementation. |
| 20 int RequestPermission( | 20 int RequestPermission( |
| 21 PermissionType permission, | 21 PermissionType permission, |
| 22 RenderFrameHost* render_frame_host, | 22 RenderFrameHost* render_frame_host, |
| 23 const GURL& requesting_origin, | 23 const GURL& requesting_origin, |
| 24 const base::Callback<void(PermissionStatus)>& callback) override; | 24 const base::Callback<void(mojom::PermissionStatus)>& callback) override; |
| 25 int RequestPermissions( | 25 int RequestPermissions( |
| 26 const std::vector<PermissionType>& permission, | 26 const std::vector<PermissionType>& permission, |
| 27 RenderFrameHost* render_frame_host, | 27 RenderFrameHost* render_frame_host, |
| 28 const GURL& requesting_origin, | 28 const GURL& requesting_origin, |
| 29 const base::Callback<void( | 29 const base::Callback<void(const std::vector<mojom::PermissionStatus>&)>& |
| 30 const std::vector<PermissionStatus>&)>& callback) override; | 30 callback) override; |
| 31 void CancelPermissionRequest(int request_id) override; | 31 void CancelPermissionRequest(int request_id) override; |
| 32 void ResetPermission(PermissionType permission, | 32 void ResetPermission(PermissionType permission, |
| 33 const GURL& requesting_origin, | 33 const GURL& requesting_origin, |
| 34 const GURL& embedding_origin) override; | 34 const GURL& embedding_origin) override; |
| 35 PermissionStatus GetPermissionStatus(PermissionType permission, | 35 mojom::PermissionStatus GetPermissionStatus( |
| 36 const GURL& requesting_origin, | 36 PermissionType permission, |
| 37 const GURL& embedding_origin) override; | 37 const GURL& requesting_origin, |
| 38 const GURL& embedding_origin) override; |
| 38 void RegisterPermissionUsage(PermissionType permission, | 39 void RegisterPermissionUsage(PermissionType permission, |
| 39 const GURL& requesting_origin, | 40 const GURL& requesting_origin, |
| 40 const GURL& embedding_origin) override; | 41 const GURL& embedding_origin) override; |
| 41 int SubscribePermissionStatusChange( | 42 int SubscribePermissionStatusChange( |
| 42 PermissionType permission, | 43 PermissionType permission, |
| 43 const GURL& requesting_origin, | 44 const GURL& requesting_origin, |
| 44 const GURL& embedding_origin, | 45 const GURL& embedding_origin, |
| 45 const base::Callback<void(PermissionStatus)>& callback) override; | 46 const base::Callback<void(mojom::PermissionStatus)>& callback) override; |
| 46 void UnsubscribePermissionStatusChange(int subscription_id) override; | 47 void UnsubscribePermissionStatusChange(int subscription_id) override; |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(ShellPermissionManager); | 50 DISALLOW_COPY_AND_ASSIGN(ShellPermissionManager); |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace content | 53 } // namespace content |
| 53 | 54 |
| 54 #endif // CONTENT_SHELL_BROWSER_SHELL_PERMISSION_MANAGER_H | 55 #endif // CONTENT_SHELL_BROWSER_SHELL_PERMISSION_MANAGER_H |
| OLD | NEW |