OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_PERMISSIONS_DELEGATION_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_DELEGATION_TRACKER_H_ |
6 #define CHROME_BROWSER_PERMISSIONS_DELEGATION_TRACKER_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_DELEGATION_TRACKER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 class RenderFrameHost; | 16 class RenderFrameHost; |
17 class WebContents; | |
18 enum class PermissionType; | 17 enum class PermissionType; |
19 | 18 |
20 } // namespace content | 19 } // namespace content |
21 | 20 |
22 // Keeps track of which permissions are delegated to frames. There are two | 21 // Keeps track of which permissions are delegated to frames. There are two |
23 // operations possible: | 22 // operations possible: |
24 // 1) Setting the permissions which are delegated to a frame by its parent, and | 23 // 1) Setting the permissions which are delegated to a frame by its parent, and |
25 // 2) Querying whether a particular permission is granted to a frame. | 24 // 2) Querying whether a particular permission is granted to a frame. |
26 // | 25 // |
27 // If a frame is destroyed or navigated, permissions will no longer be delegated | 26 // If a frame is destroyed or navigated, permissions will no longer be delegated |
(...skipping 23 matching lines...) Expand all Loading... |
51 void RenderFrameHostChanged(content::RenderFrameHost* rfh); | 50 void RenderFrameHostChanged(content::RenderFrameHost* rfh); |
52 | 51 |
53 std::unordered_map<content::RenderFrameHost*, | 52 std::unordered_map<content::RenderFrameHost*, |
54 std::unique_ptr<DelegatedForChild>> | 53 std::unique_ptr<DelegatedForChild>> |
55 delegated_permissions_; | 54 delegated_permissions_; |
56 | 55 |
57 DISALLOW_COPY_AND_ASSIGN(DelegationTracker); | 56 DISALLOW_COPY_AND_ASSIGN(DelegationTracker); |
58 }; | 57 }; |
59 | 58 |
60 #endif // CHROME_BROWSER_PERMISSIONS_DELEGATION_TRACKER_H_ | 59 #endif // CHROME_BROWSER_PERMISSIONS_DELEGATION_TRACKER_H_ |
OLD | NEW |