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

Side by Side Diff: chrome/common/extensions/extension_permission_set.cc

Issue 9717011: Expose the chrome.windows.* API to platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable WindowsApi on Aura.x Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/common/extensions/extension_permission_set.h" 5 #include "chrome/common/extensions/extension_permission_set.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 ExtensionPermissionMessage::kFullAccess, kFlagImpliesFullURLAccess | 335 ExtensionPermissionMessage::kFullAccess, kFlagImpliesFullURLAccess |
336 kFlagImpliesFullAccess | kFlagCannotBeOptional); 336 kFlagImpliesFullAccess | kFlagCannotBeOptional);
337 337
338 // Platform-app permissions. 338 // Platform-app permissions.
339 info->RegisterPermission( 339 info->RegisterPermission(
340 kSocket, "socket", 0, ExtensionPermissionMessage::kNone, 340 kSocket, "socket", 0, ExtensionPermissionMessage::kNone,
341 kFlagCannotBeOptional); 341 kFlagCannotBeOptional);
342 342
343 // Register aliases. 343 // Register aliases.
344 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); 344 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission);
345 // TODO(mihaip): Remove this alias for platform apps, and only give them
346 // access to the chrome.windows.* APIs, but not the chrome.tabs.* ones.
345 info->RegisterAlias("tabs", kWindowsPermission); 347 info->RegisterAlias("tabs", kWindowsPermission);
346 } 348 }
347 349
348 // 350 //
349 // ExtensionPermissionsInfo 351 // ExtensionPermissionsInfo
350 // 352 //
351 353
352 // static 354 // static
353 ExtensionPermissionsInfo* ExtensionPermissionsInfo::GetInstance() { 355 ExtensionPermissionsInfo* ExtensionPermissionsInfo::GetInstance() {
354 return Singleton<ExtensionPermissionsInfo>::get(); 356 return Singleton<ExtensionPermissionsInfo>::get();
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); 876 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false));
875 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); 877 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false));
876 std::set<std::string> new_hosts_only; 878 std::set<std::string> new_hosts_only;
877 879
878 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), 880 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(),
879 old_hosts_set.begin(), old_hosts_set.end(), 881 old_hosts_set.begin(), old_hosts_set.end(),
880 std::inserter(new_hosts_only, new_hosts_only.begin())); 882 std::inserter(new_hosts_only, new_hosts_only.begin()));
881 883
882 return !new_hosts_only.empty(); 884 return !new_hosts_only.empty();
883 } 885 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/windows.json ('k') | chrome/test/data/extensions/platform_apps/windows_api/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698