Chromium Code Reviews| 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 "blimp/engine/app/blimp_permission_manager.h" | 5 #include "blimp/engine/app/blimp_permission_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "content/public/browser/permission_type.h" | 10 #include "content/public/browser/permission_type.h" |
| 11 | 11 |
| 12 namespace blimp { | 12 namespace blimp { |
| 13 namespace engine { | 13 namespace engine { |
| 14 | 14 |
| 15 BlimpPermissionManager::BlimpPermissionManager() | 15 BlimpPermissionManager::BlimpPermissionManager() |
| 16 : content::PermissionManager() {} | 16 : content::PermissionManager() {} |
| 17 | 17 |
| 18 BlimpPermissionManager::~BlimpPermissionManager() {} | 18 BlimpPermissionManager::~BlimpPermissionManager() {} |
| 19 | 19 |
| 20 int BlimpPermissionManager::RequestPermission( | 20 int BlimpPermissionManager::RequestPermission( |
| 21 content::PermissionType permission, | 21 content::PermissionType permission, |
| 22 content::RenderFrameHost* render_frame_host, | 22 content::RenderFrameHost* render_frame_host, |
| 23 const GURL& origin, | 23 const GURL& origin, |
| 24 bool user_gesture, | 24 bool user_gesture, |
| 25 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { | 25 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { |
| 26 callback.Run(blink::mojom::PermissionStatus::DENIED); | 26 if (permission == content::PermissionType::GEOLOCATION) { |
| 27 VLOG(1) << "Permission requested and granted."; | |
|
Kevin M
2016/09/01 20:01:07
"Geolocation permission granted"
CJ
2016/09/01 22:59:42
Done.
| |
| 28 callback.Run(blink::mojom::PermissionStatus::GRANTED); | |
| 29 } else { | |
| 30 VLOG(1) << "Permission requested and denied."; | |
|
Kevin M
2016/09/01 20:01:06
Log |permission|?
CJ
2016/09/01 22:59:42
It's an enum class.
| |
| 31 callback.Run(blink::mojom::PermissionStatus::DENIED); | |
| 32 } | |
| 27 return kNoPendingOperation; | 33 return kNoPendingOperation; |
| 28 } | 34 } |
| 29 | 35 |
| 30 int BlimpPermissionManager::RequestPermissions( | 36 int BlimpPermissionManager::RequestPermissions( |
| 31 const std::vector<content::PermissionType>& permission, | 37 const std::vector<content::PermissionType>& permission, |
| 32 content::RenderFrameHost* render_frame_host, | 38 content::RenderFrameHost* render_frame_host, |
| 33 const GURL& requesting_origin, | 39 const GURL& requesting_origin, |
| 34 bool user_gesture, | 40 bool user_gesture, |
| 35 const base::Callback< | 41 const base::Callback< |
| 36 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) { | 42 void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) { |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 63 const GURL& embedding_origin, | 69 const GURL& embedding_origin, |
| 64 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { | 70 const base::Callback<void(blink::mojom::PermissionStatus)>& callback) { |
| 65 return -1; | 71 return -1; |
| 66 } | 72 } |
| 67 | 73 |
| 68 void BlimpPermissionManager::UnsubscribePermissionStatusChange( | 74 void BlimpPermissionManager::UnsubscribePermissionStatusChange( |
| 69 int subscription_id) {} | 75 int subscription_id) {} |
| 70 | 76 |
| 71 } // namespace engine | 77 } // namespace engine |
| 72 } // namespace blimp | 78 } // namespace blimp |
| OLD | NEW |