OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_EXPANDED_STATE_TRACKER_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_EXPANDED_STATE_TRACKER_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_EXPANDED_STATE_TRACKER_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_EXPANDED_STATE_TRACKER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | 10 #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
11 | 11 |
12 class BookmarkModel; | 12 class BookmarkModel; |
13 class BookmarkNode; | 13 class BookmarkNode; |
14 class PrefService; | 14 class PrefService; |
15 | 15 |
| 16 namespace bookmarks { |
| 17 |
16 // BookmarkExpandedStateTracker is used to track a set of expanded nodes. The | 18 // BookmarkExpandedStateTracker is used to track a set of expanded nodes. The |
17 // nodes are persisted in preferences. If an expanded node is removed from the | 19 // nodes are persisted in preferences. If an expanded node is removed from the |
18 // model BookmarkExpandedStateTracker removes the node. | 20 // model BookmarkExpandedStateTracker removes the node. |
19 class BookmarkExpandedStateTracker : public BaseBookmarkModelObserver { | 21 class BookmarkExpandedStateTracker : public BaseBookmarkModelObserver { |
20 public: | 22 public: |
21 typedef std::set<const BookmarkNode*> Nodes; | 23 typedef std::set<const BookmarkNode*> Nodes; |
22 | 24 |
23 BookmarkExpandedStateTracker(BookmarkModel* bookmark_model, | 25 BookmarkExpandedStateTracker(BookmarkModel* bookmark_model, |
24 PrefService* pref_service); | 26 PrefService* pref_service); |
25 virtual ~BookmarkExpandedStateTracker(); | 27 virtual ~BookmarkExpandedStateTracker(); |
(...skipping 20 matching lines...) Expand all Loading... |
46 // Updates the value for |prefs::kBookmarkEditorExpandedNodes| from | 48 // Updates the value for |prefs::kBookmarkEditorExpandedNodes| from |
47 // GetExpandedNodes(). | 49 // GetExpandedNodes(). |
48 void UpdatePrefs(const Nodes& nodes); | 50 void UpdatePrefs(const Nodes& nodes); |
49 | 51 |
50 BookmarkModel* bookmark_model_; | 52 BookmarkModel* bookmark_model_; |
51 PrefService* pref_service_; | 53 PrefService* pref_service_; |
52 | 54 |
53 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTracker); | 55 DISALLOW_COPY_AND_ASSIGN(BookmarkExpandedStateTracker); |
54 }; | 56 }; |
55 | 57 |
| 58 } // namespace bookmarks |
| 59 |
56 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_EXPANDED_STATE_TRACKER_H_ | 60 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_EXPANDED_STATE_TRACKER_H_ |
OLD | NEW |