OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "extensions/common/permissions/permission_set.h" | 5 #include "extensions/common/permissions/permission_set.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 return false; | 243 return false; |
244 } | 244 } |
245 | 245 |
246 PermissionSet::~PermissionSet() {} | 246 PermissionSet::~PermissionSet() {} |
247 | 247 |
248 void PermissionSet::InitImplicitPermissions() { | 248 void PermissionSet::InitImplicitPermissions() { |
249 // The downloads permission implies the internal version as well. | 249 // The downloads permission implies the internal version as well. |
250 if (apis_.find(APIPermission::kDownloads) != apis_.end()) | 250 if (apis_.find(APIPermission::kDownloads) != apis_.end()) |
251 apis_.insert(APIPermission::kDownloadsInternal); | 251 apis_.insert(APIPermission::kDownloadsInternal); |
252 | 252 |
253 // TODO(fsamuel): Is there a better way to request access to the WebRequest | |
254 // API without exposing it to the Chrome App? | |
255 if (apis_.find(APIPermission::kWebView) != apis_.end()) | |
256 apis_.insert(APIPermission::kWebRequestInternal); | |
257 | |
258 // The webRequest permission implies the internal version as well. | |
259 if (apis_.find(APIPermission::kWebRequest) != apis_.end()) | |
260 apis_.insert(APIPermission::kWebRequestInternal); | |
261 | |
262 // The fileBrowserHandler permission implies the internal version as well. | 253 // The fileBrowserHandler permission implies the internal version as well. |
263 if (apis_.find(APIPermission::kFileBrowserHandler) != apis_.end()) | 254 if (apis_.find(APIPermission::kFileBrowserHandler) != apis_.end()) |
264 apis_.insert(APIPermission::kFileBrowserHandlerInternal); | 255 apis_.insert(APIPermission::kFileBrowserHandlerInternal); |
265 } | 256 } |
266 | 257 |
267 void PermissionSet::InitEffectiveHosts() { | 258 void PermissionSet::InitEffectiveHosts() { |
268 effective_hosts_.ClearPatterns(); | 259 effective_hosts_.ClearPatterns(); |
269 | 260 |
270 URLPatternSet::CreateUnion( | 261 URLPatternSet::CreateUnion( |
271 explicit_hosts(), scriptable_hosts(), &effective_hosts_); | 262 explicit_hosts(), scriptable_hosts(), &effective_hosts_); |
272 } | 263 } |
273 | 264 |
274 } // namespace extensions | 265 } // namespace extensions |
OLD | NEW |