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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 }; | 629 }; |
630 | 630 |
631 // CookiesTreeModel ----------------------------------------------------------- | 631 // CookiesTreeModel ----------------------------------------------------------- |
632 class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { | 632 class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { |
633 public: | 633 public: |
634 CookiesTreeModel(LocalDataContainer* data_container, | 634 CookiesTreeModel(LocalDataContainer* data_container, |
635 ExtensionSpecialStoragePolicy* special_storage_policy, | 635 ExtensionSpecialStoragePolicy* special_storage_policy, |
636 bool group_by_cookie_source); | 636 bool group_by_cookie_source); |
637 ~CookiesTreeModel() override; | 637 ~CookiesTreeModel() override; |
638 | 638 |
| 639 // Given a CanonicalCookie, return the ID of the message which should be |
| 640 // displayed in various ports' "Send for:" UI. |
| 641 static int GetSendForMessageID(const net::CanonicalCookie& cookie); |
| 642 |
639 // Because non-cookie nodes are fetched in a background thread, they are not | 643 // Because non-cookie nodes are fetched in a background thread, they are not |
640 // present at the time the Model is created. The Model then notifies its | 644 // present at the time the Model is created. The Model then notifies its |
641 // observers for every item added from databases, local storage, and | 645 // observers for every item added from databases, local storage, and |
642 // appcache. We extend the Observer interface to add notifications before and | 646 // appcache. We extend the Observer interface to add notifications before and |
643 // after these batch inserts. | 647 // after these batch inserts. |
644 class Observer : public ui::TreeModelObserver { | 648 class Observer : public ui::TreeModelObserver { |
645 public: | 649 public: |
646 virtual void TreeModelBeginBatch(CookiesTreeModel* model) {} | 650 virtual void TreeModelBeginBatch(CookiesTreeModel* model) {} |
647 virtual void TreeModelEndBatch(CookiesTreeModel* model) {} | 651 virtual void TreeModelEndBatch(CookiesTreeModel* model) {} |
648 }; | 652 }; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 | 816 |
813 // Counts how many batches have started already. If this is non-zero and lower | 817 // Counts how many batches have started already. If this is non-zero and lower |
814 // than batches_ended_, then this model is still batching updates. | 818 // than batches_ended_, then this model is still batching updates. |
815 int batches_started_; | 819 int batches_started_; |
816 | 820 |
817 // Counts how many batches have finished. | 821 // Counts how many batches have finished. |
818 int batches_ended_; | 822 int batches_ended_; |
819 }; | 823 }; |
820 | 824 |
821 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ | 825 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIES_TREE_MODEL_H_ |
OLD | NEW |