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_MANAGED_MANAGED_BOOKMARKS_TRACKER_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARKS_TRACKER_H_ |
6 #define COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARKS_TRACKER_H_ | 6 #define COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARKS_TRACKER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
| 11 #include <memory> |
| 12 |
11 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
12 #include "base/macros.h" | 14 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
15 #include "components/prefs/pref_change_registrar.h" | 16 #include "components/prefs/pref_change_registrar.h" |
16 | 17 |
17 class GURL; | 18 class GURL; |
18 class PrefService; | 19 class PrefService; |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class ListValue; | 22 class ListValue; |
22 } | 23 } |
23 | 24 |
(...skipping 20 matching lines...) Expand all Loading... |
44 // If |is_supervised| is true, this will track supervised bookmarks rather | 45 // If |is_supervised| is true, this will track supervised bookmarks rather |
45 // than managed bookmarks. | 46 // than managed bookmarks. |
46 ManagedBookmarksTracker(BookmarkModel* model, | 47 ManagedBookmarksTracker(BookmarkModel* model, |
47 PrefService* prefs, | 48 PrefService* prefs, |
48 bool is_supervised, | 49 bool is_supervised, |
49 const GetManagementDomainCallback& callback); | 50 const GetManagementDomainCallback& callback); |
50 ~ManagedBookmarksTracker(); | 51 ~ManagedBookmarksTracker(); |
51 | 52 |
52 // Returns the initial list of managed bookmarks, which can be passed to | 53 // Returns the initial list of managed bookmarks, which can be passed to |
53 // LoadInitial() to do the initial load. | 54 // LoadInitial() to do the initial load. |
54 scoped_ptr<base::ListValue> GetInitialManagedBookmarks(); | 55 std::unique_ptr<base::ListValue> GetInitialManagedBookmarks(); |
55 | 56 |
56 // Loads the initial managed/supervised bookmarks in |list| into |folder|. | 57 // Loads the initial managed/supervised bookmarks in |list| into |folder|. |
57 // New nodes will be assigned IDs starting at |next_node_id|. | 58 // New nodes will be assigned IDs starting at |next_node_id|. |
58 // Returns the next node ID to use. | 59 // Returns the next node ID to use. |
59 static int64_t LoadInitial(BookmarkNode* folder, | 60 static int64_t LoadInitial(BookmarkNode* folder, |
60 const base::ListValue* list, | 61 const base::ListValue* list, |
61 int64_t next_node_id); | 62 int64_t next_node_id); |
62 | 63 |
63 // Starts tracking the pref for updates to the managed/supervised bookmarks. | 64 // Starts tracking the pref for updates to the managed/supervised bookmarks. |
64 // Should be called after loading the initial bookmarks. | 65 // Should be called after loading the initial bookmarks. |
(...skipping 24 matching lines...) Expand all Loading... |
89 PrefChangeRegistrar registrar_; | 90 PrefChangeRegistrar registrar_; |
90 GetManagementDomainCallback get_management_domain_callback_; | 91 GetManagementDomainCallback get_management_domain_callback_; |
91 | 92 |
92 DISALLOW_COPY_AND_ASSIGN(ManagedBookmarksTracker); | 93 DISALLOW_COPY_AND_ASSIGN(ManagedBookmarksTracker); |
93 }; | 94 }; |
94 | 95 |
95 } // namespace bookmarks | 96 } // namespace bookmarks |
96 | 97 |
97 #endif // COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARKS_TRACKER_H_ | 98 #endif // COMPONENTS_BOOKMARKS_MANAGED_MANAGED_BOOKMARKS_TRACKER_H_ |
98 | 99 |
OLD | NEW |