Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: android_webview/browser/aw_permission_manager.h

Issue 2110343002: Reintroduce plumbing for user gesture into permission system. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | android_webview/browser/aw_permission_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_
6 #define ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/id_map.h" 11 #include "base/id_map.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "content/public/browser/permission_manager.h" 14 #include "content/public/browser/permission_manager.h"
15 15
16 namespace android_webview { 16 namespace android_webview {
17 17
18 class LastRequestResultCache; 18 class LastRequestResultCache;
19 19
20 class AwPermissionManager : public content::PermissionManager { 20 class AwPermissionManager : public content::PermissionManager {
21 public: 21 public:
22 AwPermissionManager(); 22 AwPermissionManager();
23 ~AwPermissionManager() override; 23 ~AwPermissionManager() override;
24 24
25 // PermissionManager implementation. 25 // PermissionManager implementation.
26 int RequestPermission( 26 int RequestPermission(
27 content::PermissionType permission, 27 content::PermissionType permission,
28 content::RenderFrameHost* render_frame_host, 28 content::RenderFrameHost* render_frame_host,
29 const GURL& requesting_origin, 29 const GURL& requesting_origin,
30 bool user_gesture,
30 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) 31 const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
31 override; 32 override;
32 int RequestPermissions( 33 int RequestPermissions(
33 const std::vector<content::PermissionType>& permissions, 34 const std::vector<content::PermissionType>& permissions,
34 content::RenderFrameHost* render_frame_host, 35 content::RenderFrameHost* render_frame_host,
35 const GURL& requesting_origin, 36 const GURL& requesting_origin,
37 bool user_gesture,
36 const base::Callback< 38 const base::Callback<
37 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) 39 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback)
38 override; 40 override;
39 void CancelPermissionRequest(int request_id) override; 41 void CancelPermissionRequest(int request_id) override;
40 void ResetPermission(content::PermissionType permission, 42 void ResetPermission(content::PermissionType permission,
41 const GURL& requesting_origin, 43 const GURL& requesting_origin,
42 const GURL& embedding_origin) override; 44 const GURL& embedding_origin) override;
43 blink::mojom::PermissionStatus GetPermissionStatus( 45 blink::mojom::PermissionStatus GetPermissionStatus(
44 content::PermissionType permission, 46 content::PermissionType permission,
45 const GURL& requesting_origin, 47 const GURL& requesting_origin,
(...skipping 27 matching lines...) Expand all
73 std::unique_ptr<LastRequestResultCache> result_cache_; 75 std::unique_ptr<LastRequestResultCache> result_cache_;
74 76
75 base::WeakPtrFactory<AwPermissionManager> weak_ptr_factory_; 77 base::WeakPtrFactory<AwPermissionManager> weak_ptr_factory_;
76 78
77 DISALLOW_COPY_AND_ASSIGN(AwPermissionManager); 79 DISALLOW_COPY_AND_ASSIGN(AwPermissionManager);
78 }; 80 };
79 81
80 } // namespace android_webview 82 } // namespace android_webview
81 83
82 #endif // ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_ 84 #endif // ANDROID_WEBVIEW_BROWSER_AW_PERMISSION_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/aw_permission_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698