Skip to content

Commit

Permalink
Rename fileSystem.retainFiles to fileSystem.retainEntries.
Browse files Browse the repository at this point in the history
BUG=224684

Review URL: https://chromiumcodereview.appspot.com/18615002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210104 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
[email protected] committed Jul 4, 2013
1 parent 2a1c343 commit 73f73a0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/saved_files_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ const SavedFileEntry* SavedFilesService::GetFileEntry(
void SavedFilesService::ClearQueueIfNoRetainPermission(
const Extension* extension) {
if (!extension->GetActivePermissions()->HasAPIPermission(
APIPermission::kFileSystemRetainFiles)) {
APIPermission::kFileSystemRetainEntries)) {
ClearQueue(extension);
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/saved_files_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class SavedFilesService : public BrowserContextKeyedService,
const std::string& extension_id);

// Clears all retained files if the app does not have the
// fileSystem.retainFiles permission.
// fileSystem.retainEntries permission.
void ClearQueueIfNoRetainPermission(const extensions::Extension* extension);

// Clears all retained files.
Expand Down
8 changes: 4 additions & 4 deletions apps/saved_files_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SavedFilesServiceUnitTest : public testing::Test {
" }"
" },"
" \"permissions\": ["
" {\"fileSystem\": [\"retainFiles\"]}"
" {\"fileSystem\": [\"retainEntries\"]}"
" ]"
"}"));
service_ = SavedFilesService::Get(env_.profile());
Expand Down Expand Up @@ -133,7 +133,7 @@ TEST_F(SavedFilesServiceUnitTest, RetainTwoFilesTest) {
EXPECT_FALSE(service_->GetFileEntry(extension_->id(), "another id"));

// ClearQueueIfNoRetainPermission should be a no-op because the app has the
// fileSystem.retainFiles permission.
// fileSystem.retainEntries permission.
service_->ClearQueueIfNoRetainPermission(extension_);
TRACE_CALL(CheckEntrySequenceNumber(1, 3));
TRACE_CALL(CheckEntrySequenceNumber(2, 2));
Expand All @@ -148,7 +148,7 @@ TEST_F(SavedFilesServiceUnitTest, RetainTwoFilesTest) {
EXPECT_FALSE(service_->IsRegistered(extension_->id(), GenerateId(3)));
}

TEST_F(SavedFilesServiceUnitTest, NoRetainFilesPermissionTest) {
TEST_F(SavedFilesServiceUnitTest, NoRetainEntriesPermissionTest) {
extension_ = env_.MakeExtension(*base::test::ParseJson(
"{\"app\": {\"background\": {\"scripts\": [\"background.js\"]}},"
"\"permissions\": [\"fileSystem\"]}"));
Expand All @@ -161,7 +161,7 @@ TEST_F(SavedFilesServiceUnitTest, NoRetainFilesPermissionTest) {
EXPECT_FALSE(service_->GetFileEntry(extension_->id(), "another id"));

// ClearQueueIfNoRetainPermission should clear the queue, since the app does
// not have the "retainFiles" permission.
// not have the "retainEntries" permission.
service_->ClearQueueIfNoRetainPermission(extension_);
std::vector<SavedFileEntry> entries =
service_->GetAllFileEntries(extension_->id());
Expand Down
2 changes: 1 addition & 1 deletion chrome/common/extensions/api/_permission_features.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"extension_types": ["extension"],
"whitelist": [ "2FC374607C2DF285634B67C64A2E356C607091C3" ]
}],
"fileSystem.retainFiles": [{
"fileSystem.retainEntries": [{
"channel": "dev",
"extension_types": ["platform_app"]
}],
Expand Down
2 changes: 1 addition & 1 deletion chrome/common/extensions/permissions/api_permission.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class APIPermission {
kFileBrowserHandlerInternal,
kFileBrowserPrivate,
kFileSystem,
kFileSystemRetainFiles,
kFileSystemRetainEntries,
kFileSystemWrite,
kFontSettings,
kFullscreen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ std::vector<APIPermissionInfo*> ChromeAPIPermissions::GetAllPermissions()
// a file chooser dialog and selected a file. Selecting the file is
// considered consent to read it.
{ APIPermission::kFileSystem, "fileSystem" },
{ APIPermission::kFileSystemRetainFiles, "fileSystem.retainFiles" },
{ APIPermission::kFileSystemRetainEntries, "fileSystem.retainEntries" },
{ APIPermission::kFileSystemWrite, "fileSystem.write",
APIPermissionInfo::kFlagNone,
IDS_EXTENSION_PROMPT_WARNING_FILE_SYSTEM_WRITE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ TEST(PermissionsTest, PermissionMessages) {
// Platform apps.
skip.insert(APIPermission::kBluetooth);
skip.insert(APIPermission::kFileSystem);
skip.insert(APIPermission::kFileSystemRetainFiles);
skip.insert(APIPermission::kFileSystemRetainEntries);
skip.insert(APIPermission::kSocket);
skip.insert(APIPermission::kUsbDevice);

Expand Down

0 comments on commit 73f73a0

Please sign in to comment.