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

Side by Side Diff: content/shell/browser/shell_permission_manager.cc

Issue 1419083002: Permissions: browser/ side implementation of multiple permissions request. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « content/shell/browser/shell_permission_manager.h ('k') | no next file » | 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 #include "content/shell/browser/shell_permission_manager.h" 5 #include "content/shell/browser/shell_permission_manager.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/public/browser/permission_type.h" 9 #include "content/public/browser/permission_type.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 12 matching lines...) Expand all
23 PermissionType permission, 23 PermissionType permission,
24 RenderFrameHost* render_frame_host, 24 RenderFrameHost* render_frame_host,
25 const GURL& requesting_origin, 25 const GURL& requesting_origin,
26 bool user_gesture, 26 bool user_gesture,
27 const base::Callback<void(PermissionStatus)>& callback) { 27 const base::Callback<void(PermissionStatus)>& callback) {
28 callback.Run(permission == PermissionType::GEOLOCATION 28 callback.Run(permission == PermissionType::GEOLOCATION
29 ? PERMISSION_STATUS_GRANTED : PERMISSION_STATUS_DENIED); 29 ? PERMISSION_STATUS_GRANTED : PERMISSION_STATUS_DENIED);
30 return kNoPendingOperation; 30 return kNoPendingOperation;
31 } 31 }
32 32
33 int ShellPermissionManager::RequestPermissions(
34 const std::vector<PermissionType>& permissions,
35 content::RenderFrameHost* render_frame_host,
36 const GURL& requesting_origin,
37 bool user_gesture,
38 const base::Callback<void(
39 const std::vector<PermissionStatus>&)>& callback) {
40 std::vector<PermissionStatus> result(permissions.size());
41 for (const auto& permission : permissions) {
42 result.push_back(permission == PermissionType::GEOLOCATION
43 ? PERMISSION_STATUS_GRANTED : PERMISSION_STATUS_DENIED);
44 }
45 callback.Run(result);
46 return kNoPendingOperation;
47 }
48
33 void ShellPermissionManager::CancelPermissionRequest(int request_id) { 49 void ShellPermissionManager::CancelPermissionRequest(int request_id) {
34 } 50 }
35 51
36 void ShellPermissionManager::ResetPermission( 52 void ShellPermissionManager::ResetPermission(
37 PermissionType permission, 53 PermissionType permission,
38 const GURL& requesting_origin, 54 const GURL& requesting_origin,
39 const GURL& embedding_origin) { 55 const GURL& embedding_origin) {
40 } 56 }
41 57
42 PermissionStatus ShellPermissionManager::GetPermissionStatus( 58 PermissionStatus ShellPermissionManager::GetPermissionStatus(
(...skipping 22 matching lines...) Expand all
65 const GURL& embedding_origin, 81 const GURL& embedding_origin,
66 const base::Callback<void(PermissionStatus)>& callback) { 82 const base::Callback<void(PermissionStatus)>& callback) {
67 return kNoPendingOperation; 83 return kNoPendingOperation;
68 } 84 }
69 85
70 void ShellPermissionManager::UnsubscribePermissionStatusChange( 86 void ShellPermissionManager::UnsubscribePermissionStatusChange(
71 int subscription_id) { 87 int subscription_id) {
72 } 88 }
73 89
74 } // namespace content 90 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_permission_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698