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 #include "components/bookmarks/browser/bookmark_model.h" | 5 #include "components/bookmarks/browser/bookmark_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 private: | 91 private: |
92 icu::Collator* collator_; | 92 icu::Collator* collator_; |
93 }; | 93 }; |
94 | 94 |
95 } // namespace | 95 } // namespace |
96 | 96 |
97 // BookmarkModel -------------------------------------------------------------- | 97 // BookmarkModel -------------------------------------------------------------- |
98 | 98 |
99 BookmarkModel::BookmarkModel(BookmarkClient* client, bool index_urls) | 99 BookmarkModel::BookmarkModel(BookmarkClient* client) |
100 : client_(client), | 100 : client_(client), |
101 loaded_(false), | 101 loaded_(false), |
102 root_(GURL()), | 102 root_(GURL()), |
103 bookmark_bar_node_(NULL), | 103 bookmark_bar_node_(NULL), |
104 other_node_(NULL), | 104 other_node_(NULL), |
105 mobile_node_(NULL), | 105 mobile_node_(NULL), |
106 next_node_id_(1), | 106 next_node_id_(1), |
107 observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), | 107 observers_(ObserverList<BookmarkModelObserver>::NOTIFY_EXISTING_ONLY), |
108 index_urls_(index_urls), | |
109 loaded_signal_(true, false), | 108 loaded_signal_(true, false), |
110 extensive_changes_(0) { | 109 extensive_changes_(0) { |
111 DCHECK(client_); | 110 DCHECK(client_); |
112 } | 111 } |
113 | 112 |
114 BookmarkModel::~BookmarkModel() { | 113 BookmarkModel::~BookmarkModel() { |
115 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, | 114 FOR_EACH_OBSERVER(BookmarkModelObserver, observers_, |
116 BookmarkModelBeingDeleted(this)); | 115 BookmarkModelBeingDeleted(this)); |
117 | 116 |
118 if (store_.get()) { | 117 if (store_.get()) { |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); | 1004 CreatePermanentNode(BookmarkNode::BOOKMARK_BAR); |
1006 BookmarkPermanentNode* other_node = | 1005 BookmarkPermanentNode* other_node = |
1007 CreatePermanentNode(BookmarkNode::OTHER_NODE); | 1006 CreatePermanentNode(BookmarkNode::OTHER_NODE); |
1008 BookmarkPermanentNode* mobile_node = | 1007 BookmarkPermanentNode* mobile_node = |
1009 CreatePermanentNode(BookmarkNode::MOBILE); | 1008 CreatePermanentNode(BookmarkNode::MOBILE); |
1010 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails( | 1009 return scoped_ptr<BookmarkLoadDetails>(new BookmarkLoadDetails( |
1011 bb_node, | 1010 bb_node, |
1012 other_node, | 1011 other_node, |
1013 mobile_node, | 1012 mobile_node, |
1014 client_->GetLoadExtraNodesCallback(), | 1013 client_->GetLoadExtraNodesCallback(), |
1015 new BookmarkIndex(client_, index_urls_, accept_languages), | 1014 new BookmarkIndex(client_, accept_languages), |
1016 next_node_id_)); | 1015 next_node_id_)); |
1017 } | 1016 } |
OLD | NEW |