OLD | NEW |
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 #ifndef CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ |
7 | 7 |
8 // TODO(viettrungluu): This header file #includes far too much and has too much | 8 // TODO(viettrungluu): This header file #includes far too much and has too much |
9 // inline code (which shouldn't be inline). | 9 // inline code (which shouldn't be inline). |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 session_storage_info; | 128 session_storage_info; |
129 const appcache::AppCacheInfo* appcache_info; | 129 const appcache::AppCacheInfo* appcache_info; |
130 const content::IndexedDBInfo* indexed_db_info; | 130 const content::IndexedDBInfo* indexed_db_info; |
131 const BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info; | 131 const BrowsingDataFileSystemHelper::FileSystemInfo* file_system_info; |
132 const BrowsingDataQuotaHelper::QuotaInfo* quota_info; | 132 const BrowsingDataQuotaHelper::QuotaInfo* quota_info; |
133 const net::ServerBoundCertStore::ServerBoundCert* server_bound_cert; | 133 const net::ServerBoundCertStore::ServerBoundCert* server_bound_cert; |
134 std::string flash_lso_domain; | 134 std::string flash_lso_domain; |
135 }; | 135 }; |
136 | 136 |
137 CookieTreeNode() {} | 137 CookieTreeNode() {} |
138 explicit CookieTreeNode(const string16& title) | 138 explicit CookieTreeNode(const base::string16& title) |
139 : ui::TreeNode<CookieTreeNode>(title) {} | 139 : ui::TreeNode<CookieTreeNode>(title) {} |
140 virtual ~CookieTreeNode() {} | 140 virtual ~CookieTreeNode() {} |
141 | 141 |
142 // Delete backend storage for this node, and any children nodes. (E.g. delete | 142 // Delete backend storage for this node, and any children nodes. (E.g. delete |
143 // the cookie from CookieMonster, clear the database, and so forth.) | 143 // the cookie from CookieMonster, clear the database, and so forth.) |
144 virtual void DeleteStoredObjects(); | 144 virtual void DeleteStoredObjects(); |
145 | 145 |
146 // Gets a pointer back to the associated model for the tree we are in. | 146 // Gets a pointer back to the associated model for the tree we are in. |
147 virtual CookiesTreeModel* GetModel() const; | 147 virtual CookiesTreeModel* GetModel() const; |
148 | 148 |
(...skipping 24 matching lines...) Expand all Loading... |
173 private: | 173 private: |
174 CookiesTreeModel* model_; | 174 CookiesTreeModel* model_; |
175 | 175 |
176 DISALLOW_COPY_AND_ASSIGN(CookieTreeRootNode); | 176 DISALLOW_COPY_AND_ASSIGN(CookieTreeRootNode); |
177 }; | 177 }; |
178 | 178 |
179 // CookieTreeHostNode ------------------------------------------------------- | 179 // CookieTreeHostNode ------------------------------------------------------- |
180 class CookieTreeHostNode : public CookieTreeNode { | 180 class CookieTreeHostNode : public CookieTreeNode { |
181 public: | 181 public: |
182 // Returns the host node's title to use for a given URL. | 182 // Returns the host node's title to use for a given URL. |
183 static string16 TitleForUrl(const GURL& url); | 183 static base::string16 TitleForUrl(const GURL& url); |
184 | 184 |
185 explicit CookieTreeHostNode(const GURL& url); | 185 explicit CookieTreeHostNode(const GURL& url); |
186 virtual ~CookieTreeHostNode(); | 186 virtual ~CookieTreeHostNode(); |
187 | 187 |
188 // CookieTreeNode methods: | 188 // CookieTreeNode methods: |
189 virtual DetailedInfo GetDetailedInfo() const OVERRIDE; | 189 virtual DetailedInfo GetDetailedInfo() const OVERRIDE; |
190 | 190 |
191 // CookieTreeHostNode methods: | 191 // CookieTreeHostNode methods: |
192 CookieTreeCookiesNode* GetOrCreateCookiesNode(); | 192 CookieTreeCookiesNode* GetOrCreateCookiesNode(); |
193 CookieTreeDatabasesNode* GetOrCreateDatabasesNode(); | 193 CookieTreeDatabasesNode* GetOrCreateDatabasesNode(); |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 virtual int GetIconIndex(ui::TreeModelNode* node) OVERRIDE; | 628 virtual int GetIconIndex(ui::TreeModelNode* node) OVERRIDE; |
629 | 629 |
630 // CookiesTreeModel methods: | 630 // CookiesTreeModel methods: |
631 void DeleteAllStoredObjects(); | 631 void DeleteAllStoredObjects(); |
632 | 632 |
633 // Deletes a specific node in the tree, identified by |cookie_node|, and its | 633 // Deletes a specific node in the tree, identified by |cookie_node|, and its |
634 // subtree. | 634 // subtree. |
635 void DeleteCookieNode(CookieTreeNode* cookie_node); | 635 void DeleteCookieNode(CookieTreeNode* cookie_node); |
636 | 636 |
637 // Filter the origins to only display matched results. | 637 // Filter the origins to only display matched results. |
638 void UpdateSearchResults(const string16& filter); | 638 void UpdateSearchResults(const base::string16& filter); |
639 | 639 |
640 // Returns the set of extensions which protect the data item represented by | 640 // Returns the set of extensions which protect the data item represented by |
641 // this node from deletion. | 641 // this node from deletion. |
642 // Returns NULL if the node doesn't represent a protected data item or the | 642 // Returns NULL if the node doesn't represent a protected data item or the |
643 // special storage policy is NULL. | 643 // special storage policy is NULL. |
644 const ExtensionSet* ExtensionsProtectingNode( | 644 const ExtensionSet* ExtensionsProtectingNode( |
645 const CookieTreeNode& cookie_node); | 645 const CookieTreeNode& cookie_node); |
646 | 646 |
647 // Manages CookiesTreeModel::Observers. This will also call | 647 // Manages CookiesTreeModel::Observers. This will also call |
648 // TreeNodeModel::AddObserver so that it gets all the proper notifications. | 648 // TreeNodeModel::AddObserver so that it gets all the proper notifications. |
(...skipping 25 matching lines...) Expand all Loading... |
674 ORIGIN = 0, | 674 ORIGIN = 0, |
675 COOKIE = 1, | 675 COOKIE = 1, |
676 DATABASE = 2 | 676 DATABASE = 2 |
677 }; | 677 }; |
678 | 678 |
679 void NotifyObserverBeginBatch(); | 679 void NotifyObserverBeginBatch(); |
680 void NotifyObserverEndBatch(); | 680 void NotifyObserverEndBatch(); |
681 | 681 |
682 void PopulateAppCacheInfoWithFilter(LocalDataContainer* container, | 682 void PopulateAppCacheInfoWithFilter(LocalDataContainer* container, |
683 ScopedBatchUpdateNotifier* notifier, | 683 ScopedBatchUpdateNotifier* notifier, |
684 const string16& filter); | 684 const base::string16& filter); |
685 void PopulateCookieInfoWithFilter(LocalDataContainer* container, | 685 void PopulateCookieInfoWithFilter(LocalDataContainer* container, |
686 ScopedBatchUpdateNotifier* notifier, | 686 ScopedBatchUpdateNotifier* notifier, |
687 const string16& filter); | 687 const base::string16& filter); |
688 void PopulateDatabaseInfoWithFilter(LocalDataContainer* container, | 688 void PopulateDatabaseInfoWithFilter(LocalDataContainer* container, |
689 ScopedBatchUpdateNotifier* notifier, | 689 ScopedBatchUpdateNotifier* notifier, |
690 const string16& filter); | 690 const base::string16& filter); |
691 void PopulateLocalStorageInfoWithFilter(LocalDataContainer* container, | 691 void PopulateLocalStorageInfoWithFilter(LocalDataContainer* container, |
692 ScopedBatchUpdateNotifier* notifier, | 692 ScopedBatchUpdateNotifier* notifier, |
693 const string16& filter); | 693 const base::string16& filter); |
694 void PopulateSessionStorageInfoWithFilter(LocalDataContainer* container, | 694 void PopulateSessionStorageInfoWithFilter(LocalDataContainer* container, |
695 ScopedBatchUpdateNotifier* notifier, | 695 ScopedBatchUpdateNotifier* notifier, |
696 const string16& filter); | 696 const base::string16& filter); |
697 void PopulateIndexedDBInfoWithFilter(LocalDataContainer* container, | 697 void PopulateIndexedDBInfoWithFilter(LocalDataContainer* container, |
698 ScopedBatchUpdateNotifier* notifier, | 698 ScopedBatchUpdateNotifier* notifier, |
699 const string16& filter); | 699 const base::string16& filter); |
700 void PopulateFileSystemInfoWithFilter(LocalDataContainer* container, | 700 void PopulateFileSystemInfoWithFilter(LocalDataContainer* container, |
701 ScopedBatchUpdateNotifier* notifier, | 701 ScopedBatchUpdateNotifier* notifier, |
702 const string16& filter); | 702 const base::string16& filter); |
703 void PopulateQuotaInfoWithFilter(LocalDataContainer* container, | 703 void PopulateQuotaInfoWithFilter(LocalDataContainer* container, |
704 ScopedBatchUpdateNotifier* notifier, | 704 ScopedBatchUpdateNotifier* notifier, |
705 const string16& filter); | 705 const base::string16& filter); |
706 void PopulateServerBoundCertInfoWithFilter( | 706 void PopulateServerBoundCertInfoWithFilter( |
707 LocalDataContainer* container, | 707 LocalDataContainer* container, |
708 ScopedBatchUpdateNotifier* notifier, | 708 ScopedBatchUpdateNotifier* notifier, |
709 const string16& filter); | 709 const base::string16& filter); |
710 void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container, | 710 void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container, |
711 ScopedBatchUpdateNotifier* notifier, | 711 ScopedBatchUpdateNotifier* notifier, |
712 const string16& filter); | 712 const base::string16& filter); |
713 | 713 |
714 // Map of app ids to LocalDataContainer objects to use when retrieving | 714 // Map of app ids to LocalDataContainer objects to use when retrieving |
715 // locally stored data. | 715 // locally stored data. |
716 scoped_ptr<LocalDataContainer> data_container_; | 716 scoped_ptr<LocalDataContainer> data_container_; |
717 | 717 |
718 // The extension special storage policy; see ExtensionsProtectingNode() above. | 718 // The extension special storage policy; see ExtensionsProtectingNode() above. |
719 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; | 719 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; |
720 | 720 |
721 // The CookiesTreeModel maintains a separate list of observers that are | 721 // The CookiesTreeModel maintains a separate list of observers that are |
722 // specifically of the type CookiesTreeModel::Observer. | 722 // specifically of the type CookiesTreeModel::Observer. |
723 ObserverList<Observer> cookies_observer_list_; | 723 ObserverList<Observer> cookies_observer_list_; |
724 | 724 |
725 // If true, use the CanonicalCookie::Source attribute to group cookies. | 725 // If true, use the CanonicalCookie::Source attribute to group cookies. |
726 // Otherwise, use the CanonicalCookie::Domain attribute. | 726 // Otherwise, use the CanonicalCookie::Domain attribute. |
727 bool group_by_cookie_source_; | 727 bool group_by_cookie_source_; |
728 | 728 |
729 // If this is non-zero, then this model is batching updates (there's a lot of | 729 // If this is non-zero, then this model is batching updates (there's a lot of |
730 // notifications coming down the pipe). This is an integer is used to balance | 730 // notifications coming down the pipe). This is an integer is used to balance |
731 // calls to Begin/EndBatch() if they're called in a nested manner. | 731 // calls to Begin/EndBatch() if they're called in a nested manner. |
732 int batch_update_; | 732 int batch_update_; |
733 }; | 733 }; |
734 | 734 |
735 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ | 735 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ |
OLD | NEW |