OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "blimp/engine/app/blimp_permission_manager.h" | |
6 | |
7 #include <vector> | |
8 | |
9 #include "base/callback.h" | |
10 #include "content/public/browser/permission_type.h" | |
11 | |
12 namespace blimp { | |
13 namespace engine { | |
14 | |
15 BlimpPermissionManager::BlimpPermissionManager() | |
16 : content::PermissionManager() {} | |
17 | |
18 BlimpPermissionManager::~BlimpPermissionManager() {} | |
19 | |
20 int BlimpPermissionManager::RequestPermission( | |
21 content::PermissionType permission, | |
22 content::RenderFrameHost* render_frame_host, | |
23 const GURL& origin, | |
24 bool user_gesture, | |
25 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { | |
26 if (permission == content::PermissionType::GEOLOCATION) { | |
27 VLOG(1) << "Geolocation permission granted."; | |
28 callback.Run(blink::mojom::PermissionStatus::GRANTED); | |
29 } else { | |
30 VLOG(1) << "Permission denied."; | |
31 callback.Run(blink::mojom::PermissionStatus::DENIED); | |
32 } | |
33 return kNoPendingOperation; | |
34 } | |
35 | |
36 int BlimpPermissionManager::RequestPermissions( | |
37 const std::vector<content::PermissionType>& permission, | |
38 content::RenderFrameHost* render_frame_host, | |
39 const GURL& requesting_origin, | |
40 bool user_gesture, | |
41 const base::Callback< | |
42 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) { | |
43 callback.Run(std::vector<blink::mojom::PermissionStatus>( | |
44 permission.size(), blink::mojom::PermissionStatus::DENIED)); | |
45 return kNoPendingOperation; | |
46 } | |
47 | |
48 void BlimpPermissionManager::CancelPermissionRequest(int request_id) {} | |
49 | |
50 void BlimpPermissionManager::ResetPermission(content::PermissionType permission, | |
51 const GURL& requesting_origin, | |
52 const GURL& embedding_origin) {} | |
53 | |
54 blink::mojom::PermissionStatus BlimpPermissionManager::GetPermissionStatus( | |
55 content::PermissionType permission, | |
56 const GURL& requesting_origin, | |
57 const GURL& embedding_origin) { | |
58 return blink::mojom::PermissionStatus::DENIED; | |
59 } | |
60 | |
61 void BlimpPermissionManager::RegisterPermissionUsage( | |
62 content::PermissionType permission, | |
63 const GURL& requesting_origin, | |
64 const GURL& embedding_origin) {} | |
65 | |
66 int BlimpPermissionManager::SubscribePermissionStatusChange( | |
67 content::PermissionType permission, | |
68 const GURL& requesting_origin, | |
69 const GURL& embedding_origin, | |
70 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { | |
71 return -1; | |
72 } | |
73 | |
74 void BlimpPermissionManager::UnsubscribePermissionStatusChange( | |
75 int subscription_id) {} | |
76 | |
77 } // namespace engine | |
78 } // namespace blimp | |
OLD | NEW |