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

Unified Diff: chrome/common/extensions/file_browser_handler.h

Issue 9741002: Adding file access permissions to fileBrowserHandler manifest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unit_tests 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/file_browser_handler.h
diff --git a/chrome/common/extensions/file_browser_handler.h b/chrome/common/extensions/file_browser_handler.h
index d407bf89908e585a325457dd99fb1cc39d33038c..bb0f984c98d1f4d1e44eea3bd32e5c92680d0451 100644
--- a/chrome/common/extensions/file_browser_handler.h
+++ b/chrome/common/extensions/file_browser_handler.h
@@ -50,6 +50,21 @@ class FileBrowserHandler {
default_icon_path_ = path;
}
+ // File access permissions.
+ // Adjusts file_access_permission_flags_ to allow specified permission.
+ bool AddFileAccessPermission(const std::string& permission_str);
+ // Checks that specified file access permissions are valid (all set
+ // permissions are valid and there is no other permission specified with
+ // "create")
+ // If no access permissions were set, initialize them to default value.
+ bool ValidateFileAccessPermissions();
+ // Checks if handler has read access.
+ bool CanRead() const;
+ // Checks if handler has write access.
+ bool CanWrite() const;
+ // Checks if handler has "create" access specified.
+ bool HasCreateAccessPermission() const;
+
private:
// The id for the extension this action belongs to (as defined in the
// extension manifest).
@@ -58,6 +73,8 @@ class FileBrowserHandler {
std::string default_icon_path_;
// The id for the FileBrowserHandler, for example: "PdfFileAction".
std::string id_;
+ unsigned int file_access_permission_flags_;
+
// A list of file filters.
URLPatternSet url_set_;
};
« no previous file with comments | « chrome/common/extensions/extension_manifests_unittest.cc ('k') | chrome/common/extensions/file_browser_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698