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

Side by Side Diff: chrome/browser/browsing_data/cookies_tree_model.h

Issue 2110483002: Remove use of CanonicalCookie::Source() from browsing_data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge Created 4 years, 5 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
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 #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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 private: 679 private:
680 std::string domain_; 680 std::string domain_;
681 681
682 DISALLOW_COPY_AND_ASSIGN(CookieTreeFlashLSONode); 682 DISALLOW_COPY_AND_ASSIGN(CookieTreeFlashLSONode);
683 }; 683 };
684 684
685 // CookiesTreeModel ----------------------------------------------------------- 685 // CookiesTreeModel -----------------------------------------------------------
686 class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { 686 class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> {
687 public: 687 public:
688 CookiesTreeModel(LocalDataContainer* data_container, 688 CookiesTreeModel(LocalDataContainer* data_container,
689 ExtensionSpecialStoragePolicy* special_storage_policy, 689 ExtensionSpecialStoragePolicy* special_storage_policy);
690 bool group_by_cookie_source);
691 ~CookiesTreeModel() override; 690 ~CookiesTreeModel() override;
692 691
693 // Given a CanonicalCookie, return the ID of the message which should be 692 // Given a CanonicalCookie, return the ID of the message which should be
694 // displayed in various ports' "Send for:" UI. 693 // displayed in various ports' "Send for:" UI.
695 static int GetSendForMessageID(const net::CanonicalCookie& cookie); 694 static int GetSendForMessageID(const net::CanonicalCookie& cookie);
696 695
697 // Because non-cookie nodes are fetched in a background thread, they are not 696 // Because non-cookie nodes are fetched in a background thread, they are not
698 // present at the time the Model is created. The Model then notifies its 697 // present at the time the Model is created. The Model then notifies its
699 // observers for every item added from databases, local storage, and 698 // observers for every item added from databases, local storage, and
700 // appcache. We extend the Observer interface to add notifications before and 699 // appcache. We extend the Observer interface to add notifications before and
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 ScopedBatchUpdateNotifier* notifier, 841 ScopedBatchUpdateNotifier* notifier,
843 const base::string16& filter); 842 const base::string16& filter);
844 void PopulateCacheStorageUsageInfoWithFilter( 843 void PopulateCacheStorageUsageInfoWithFilter(
845 LocalDataContainer* container, 844 LocalDataContainer* container,
846 ScopedBatchUpdateNotifier* notifier, 845 ScopedBatchUpdateNotifier* notifier,
847 const base::string16& filter); 846 const base::string16& filter);
848 void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container, 847 void PopulateFlashLSOInfoWithFilter(LocalDataContainer* container,
849 ScopedBatchUpdateNotifier* notifier, 848 ScopedBatchUpdateNotifier* notifier,
850 const base::string16& filter); 849 const base::string16& filter);
851 850
852 // Map of app ids to LocalDataContainer objects to use when retrieving
853 // locally stored data.
854 std::unique_ptr<LocalDataContainer> data_container_;
855
856 #if defined(ENABLE_EXTENSIONS) 851 #if defined(ENABLE_EXTENSIONS)
857 // The extension special storage policy; see ExtensionsProtectingNode() above. 852 // The extension special storage policy; see ExtensionsProtectingNode() above.
858 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_; 853 scoped_refptr<ExtensionSpecialStoragePolicy> special_storage_policy_;
859 #endif 854 #endif
860 855
856 // Map of app ids to LocalDataContainer objects to use when retrieving
857 // locally stored data.
858 std::unique_ptr<LocalDataContainer> data_container_;
859
861 // The CookiesTreeModel maintains a separate list of observers that are 860 // The CookiesTreeModel maintains a separate list of observers that are
862 // specifically of the type CookiesTreeModel::Observer. 861 // specifically of the type CookiesTreeModel::Observer.
863 base::ObserverList<Observer> cookies_observer_list_; 862 base::ObserverList<Observer> cookies_observer_list_;
864 863
865 // If true, use the CanonicalCookie::Source attribute to group cookies.
866 // Otherwise, use the CanonicalCookie::Domain attribute.
867 bool group_by_cookie_source_;
868
869 // Keeps track of how many batches the consumer of this class says it is going 864 // Keeps track of how many batches the consumer of this class says it is going
870 // to send. 865 // to send.
871 int batches_expected_ = 0; 866 int batches_expected_ = 0;
872 867
873 // Keeps track of how many batches we've seen. 868 // Keeps track of how many batches we've seen.
874 int batches_seen_ = 0; 869 int batches_seen_ = 0;
875 870
876 // Counts how many batches have started already. If this is non-zero and lower 871 // Counts how many batches have started already. If this is non-zero and lower
877 // than batches_ended_, then this model is still batching updates. 872 // than batches_ended_, then this model is still batching updates.
878 int batches_started_ = 0; 873 int batches_started_ = 0;
879 874
880 // Counts how many batches have finished. 875 // Counts how many batches have finished.
881 int batches_ended_ = 0; 876 int batches_ended_ = 0;
882 }; 877 };
883 878
884 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ 879 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698