diff options
author | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-27 11:07:44 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-27 11:07:44 +0000 |
commit | 763d91fe15ecbcde91e34892280881bbab7c20a8 (patch) | |
tree | a82cfbc7ad4ea2b08e79c1a859f070d747de67fe /chrome/browser/cookies_tree_model.h | |
parent | 74ec7e6780d4d7489d3ad1cbbac7c6a17e0beed7 (diff) | |
download | chromium_src-763d91fe15ecbcde91e34892280881bbab7c20a8.zip chromium_src-763d91fe15ecbcde91e34892280881bbab7c20a8.tar.gz chromium_src-763d91fe15ecbcde91e34892280881bbab7c20a8.tar.bz2 |
Wrapping blocked filesystems into TabSpecificContentSettings
BUG=63703
TEST=TabSpecificContentSettings* in `unit_tests`
Review URL: http://codereview.chromium.org/6966036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookies_tree_model.h')
-rw-r--r-- | chrome/browser/cookies_tree_model.h | 67 |
1 files changed, 63 insertions, 4 deletions
diff --git a/chrome/browser/cookies_tree_model.h b/chrome/browser/cookies_tree_model.h index 9515f51..1f1e8448 100644 --- a/chrome/browser/cookies_tree_model.h +++ b/chrome/browser/cookies_tree_model.h @@ -18,6 +18,7 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browsing_data_appcache_helper.h" #include "chrome/browser/browsing_data_database_helper.h" +#include "chrome/browser/browsing_data_file_system_helper.h" #include "chrome/browser/browsing_data_indexed_db_helper.h" #include "chrome/browser/browsing_data_local_storage_helper.h" #include "chrome/common/content_settings.h" @@ -31,6 +32,8 @@ class CookieTreeCookieNode; class CookieTreeCookiesNode; class CookieTreeDatabaseNode; class CookieTreeDatabasesNode; +class CookieTreeFileSystemsNode; +class CookieTreeFileSystemNode; class CookieTreeLocalStorageNode; class CookieTreeLocalStoragesNode; class CookieTreeSessionStorageNode; @@ -66,6 +69,8 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { TYPE_APPCACHE, // This is used for CookieTreeAppCacheNode. TYPE_INDEXED_DBS, // This is used for CookieTreeIndexedDBsNode. TYPE_INDEXED_DB, // This is used for CookieTreeIndexedDBNode. + TYPE_FILE_SYSTEMS, // This is used for CookieTreeFileSystemsNode. + TYPE_FILE_SYSTEM, // This is used for CookieTreeFileSystemNode. }; // TODO(viettrungluu): Figure out whether we want to store |origin| as a @@ -79,7 +84,8 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { const BrowsingDataLocalStorageHelper::LocalStorageInfo* session_storage_info, const appcache::AppCacheInfo* appcache_info, - const BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info) + const BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info, + const BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info) : origin(UTF16ToWideHack(origin)), node_type(node_type), cookie(cookie), @@ -87,12 +93,14 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { local_storage_info(local_storage_info), session_storage_info(session_storage_info), appcache_info(appcache_info), - indexed_db_info(indexed_db_info) { + indexed_db_info(indexed_db_info), + file_system_info(file_system_info) { DCHECK((node_type != TYPE_DATABASE) || database_info); DCHECK((node_type != TYPE_LOCAL_STORAGE) || local_storage_info); DCHECK((node_type != TYPE_SESSION_STORAGE) || session_storage_info); DCHECK((node_type != TYPE_APPCACHE) || appcache_info); DCHECK((node_type != TYPE_INDEXED_DB) || indexed_db_info); + DCHECK((node_type != TYPE_FILE_SYSTEM) || file_system_info); } #if !defined(WCHAR_T_IS_UTF16) DetailedInfo(const std::wstring& origin, NodeType node_type, @@ -103,7 +111,8 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { const BrowsingDataLocalStorageHelper::LocalStorageInfo* session_storage_info, const appcache::AppCacheInfo* appcache_info, - const BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info) + const BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info, + const BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info) : origin(origin), node_type(node_type), cookie(cookie), @@ -111,12 +120,14 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { local_storage_info(local_storage_info), session_storage_info(session_storage_info), appcache_info(appcache_info), - indexed_db_info(indexed_db_info) { + indexed_db_info(indexed_db_info), + file_system_info(file_system_info) { DCHECK((node_type != TYPE_DATABASE) || database_info); DCHECK((node_type != TYPE_LOCAL_STORAGE) || local_storage_info); DCHECK((node_type != TYPE_SESSION_STORAGE) || session_storage_info); DCHECK((node_type != TYPE_APPCACHE) || appcache_info); DCHECK((node_type != TYPE_INDEXED_DB) || indexed_db_info); + DCHECK((node_type != TYPE_FILE_SYSTEM) || file_system_info); } #endif @@ -129,6 +140,7 @@ class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { session_storage_info; const appcache::AppCacheInfo* appcache_info; const BrowsingDataIndexedDBHelper::IndexedDBInfo* indexed_db_info; + const BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info; }; CookieTreeNode() {} @@ -198,6 +210,7 @@ class CookieTreeOriginNode : public CookieTreeNode { CookieTreeSessionStoragesNode* GetOrCreateSessionStoragesNode(); CookieTreeAppCachesNode* GetOrCreateAppCachesNode(); CookieTreeIndexedDBsNode* GetOrCreateIndexedDBsNode(); + CookieTreeFileSystemsNode* GetOrCreateFileSystemsNode(); // Creates an content exception for this origin of type // CONTENT_SETTINGS_TYPE_COOKIES. @@ -219,6 +232,7 @@ class CookieTreeOriginNode : public CookieTreeNode { CookieTreeSessionStoragesNode* session_storages_child_; CookieTreeAppCachesNode* appcaches_child_; CookieTreeIndexedDBsNode* indexed_dbs_child_; + CookieTreeFileSystemsNode* file_systems_child_; // The URL for which this node was initially created. GURL url_; @@ -334,6 +348,42 @@ class CookieTreeDatabasesNode : public CookieTreeNode { DISALLOW_COPY_AND_ASSIGN(CookieTreeDatabasesNode); }; +// CookieTreeFileSystemNode -------------------------------------------------- +class CookieTreeFileSystemNode : public CookieTreeNode { + public: + friend class CookieTreeFileSystemsNode; + + // Does not take ownership of file_system_info, and file_system_info should + // remain valid at least as long as the CookieTreeFileSystemNode is valid. + explicit CookieTreeFileSystemNode( + BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info); + virtual ~CookieTreeFileSystemNode(); + + virtual void DeleteStoredObjects(); + virtual DetailedInfo GetDetailedInfo() const; + + private: + // file_system_info_ is not owned by the node, and is expected to remain + // valid as long as the CookieTreeFileSystemNode is valid. + BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info_; + + DISALLOW_COPY_AND_ASSIGN(CookieTreeFileSystemNode); +}; + +class CookieTreeFileSystemsNode : public CookieTreeNode { + public: + CookieTreeFileSystemsNode(); + virtual ~CookieTreeFileSystemsNode(); + + virtual DetailedInfo GetDetailedInfo() const; + + void AddFileSystemNode(CookieTreeFileSystemNode* child) { + AddChildSortedByTitle(child); + } + + private: + DISALLOW_COPY_AND_ASSIGN(CookieTreeFileSystemsNode); +}; // CookieTreeLocalStorageNode ------------------------------------------------- class CookieTreeLocalStorageNode : public CookieTreeNode { @@ -470,6 +520,7 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { BrowsingDataLocalStorageHelper* session_storage_helper, BrowsingDataAppCacheHelper* appcache_helper, BrowsingDataIndexedDBHelper* indexed_db_helper, + BrowsingDataFileSystemHelper* file_system_helper, bool use_cookie_source); virtual ~CookiesTreeModel(); @@ -512,6 +563,8 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { SessionStorageInfoList; typedef std::vector<BrowsingDataIndexedDBHelper::IndexedDBInfo> IndexedDBInfoList; + typedef std::vector<BrowsingDataFileSystemHelper::FileSystemInfo> + FileSystemInfoList; void LoadCookies(); void LoadCookiesWithFilter(const std::wstring& filter); @@ -524,12 +577,15 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { const LocalStorageInfoList& local_storage_info); void OnIndexedDBModelInfoLoaded( const IndexedDBInfoList& indexed_db_info); + void OnFileSystemModelInfoLoaded( + const FileSystemInfoList& file_system_info); void PopulateAppCacheInfoWithFilter(const std::wstring& filter); void PopulateDatabaseInfoWithFilter(const std::wstring& filter); void PopulateLocalStorageInfoWithFilter(const std::wstring& filter); void PopulateSessionStorageInfoWithFilter(const std::wstring& filter); void PopulateIndexedDBInfoWithFilter(const std::wstring& filter); + void PopulateFileSystemInfoWithFilter(const std::wstring& filter); void NotifyObserverBeginBatch(); void NotifyObserverEndBatch(); @@ -545,9 +601,11 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper_; scoped_refptr<BrowsingDataLocalStorageHelper> session_storage_helper_; scoped_refptr<BrowsingDataIndexedDBHelper> indexed_db_helper_; + scoped_refptr<BrowsingDataFileSystemHelper> file_system_helper_; LocalStorageInfoList local_storage_info_list_; LocalStorageInfoList session_storage_info_list_; IndexedDBInfoList indexed_db_info_list_; + FileSystemInfoList file_system_info_list_; // The CookiesTreeModel maintains a separate list of observers that are // specifically of the type CookiesTreeModel::Observer. @@ -567,6 +625,7 @@ class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { friend class CookieTreeDatabaseNode; friend class CookieTreeLocalStorageNode; friend class CookieTreeIndexedDBNode; + friend class CookieTreeFileSystemNode; DISALLOW_COPY_AND_ASSIGN(CookiesTreeModel); }; |