| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/bookmarks/managed/managed_bookmark_service.h" | 5 #include "components/bookmarks/managed/managed_bookmark_service.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 |
| 9 #include <utility> | 10 #include <utility> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/bind.h" | 13 #include "base/bind.h" |
| 13 #include "base/callback.h" | 14 #include "base/callback.h" |
| 14 #include "base/logging.h" | 15 #include "base/logging.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 17 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 18 #include "base/values.h" | 19 #include "base/values.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 // Returns a list of initialized BookmarkPermanentNodes using |next_node_id| to | 65 // Returns a list of initialized BookmarkPermanentNodes using |next_node_id| to |
| 65 // start assigning id. |next_node_id| is updated as a side effect of calling | 66 // start assigning id. |next_node_id| is updated as a side effect of calling |
| 66 // this method. | 67 // this method. |
| 67 BookmarkPermanentNodeList LoadExtraNodes( | 68 BookmarkPermanentNodeList LoadExtraNodes( |
| 68 ScopedVector<BookmarkPermanentNodeLoader> loaders, | 69 ScopedVector<BookmarkPermanentNodeLoader> loaders, |
| 69 int64_t* next_node_id) { | 70 int64_t* next_node_id) { |
| 70 BookmarkPermanentNodeList extra_nodes; | 71 BookmarkPermanentNodeList extra_nodes; |
| 71 for (auto* loader : loaders) | 72 for (auto* loader : loaders) |
| 72 extra_nodes.push_back(loader->Load(next_node_id).release()); | 73 extra_nodes.push_back(loader->Load(next_node_id)); |
| 73 return extra_nodes; | 74 return extra_nodes; |
| 74 } | 75 } |
| 75 | 76 |
| 76 } // namespace | 77 } // namespace |
| 77 | 78 |
| 78 ManagedBookmarkService::ManagedBookmarkService( | 79 ManagedBookmarkService::ManagedBookmarkService( |
| 79 PrefService* prefs, | 80 PrefService* prefs, |
| 80 const GetManagementDomainCallback& callback) | 81 const GetManagementDomainCallback& callback) |
| 81 : prefs_(prefs), | 82 : prefs_(prefs), |
| 82 bookmark_model_(nullptr), | 83 bookmark_model_(nullptr), |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 180 } |
| 180 | 181 |
| 181 managed_bookmarks_tracker_.reset(); | 182 managed_bookmarks_tracker_.reset(); |
| 182 supervised_bookmarks_tracker_.reset(); | 183 supervised_bookmarks_tracker_.reset(); |
| 183 | 184 |
| 184 managed_node_ = nullptr; | 185 managed_node_ = nullptr; |
| 185 supervised_node_ = nullptr; | 186 supervised_node_ = nullptr; |
| 186 } | 187 } |
| 187 | 188 |
| 188 } // namespace bookmarks | 189 } // namespace bookmarks |
| OLD | NEW |