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_CORE_BROWSER_BOOKMARK_MODEL_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_MODEL_H_ |
6 #define COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_MODEL_H_ | 6 #define COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_MODEL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 243 |
244 // Returns the next node ID. | 244 // Returns the next node ID. |
245 int64 next_node_id() const { return next_node_id_; } | 245 int64 next_node_id() const { return next_node_id_; } |
246 | 246 |
247 // Returns the object responsible for tracking the set of expanded nodes in | 247 // Returns the object responsible for tracking the set of expanded nodes in |
248 // the bookmark editor. | 248 // the bookmark editor. |
249 BookmarkExpandedStateTracker* expanded_state_tracker() { | 249 BookmarkExpandedStateTracker* expanded_state_tracker() { |
250 return expanded_state_tracker_.get(); | 250 return expanded_state_tracker_.get(); |
251 } | 251 } |
252 | 252 |
253 // Sets the visibility of one of the permanent nodes. This is set by sync. | 253 // Sets the visibility of one of the permanent nodes (unless the node must |
| 254 // always be visible, see |BookmarkClient::IsPermanentNodeVisible| for more |
| 255 // details). This is set by sync. |
254 void SetPermanentNodeVisible(BookmarkNode::Type type, bool value); | 256 void SetPermanentNodeVisible(BookmarkNode::Type type, bool value); |
255 | 257 |
| 258 // Returns the permanent node of type |type|. |
| 259 const BookmarkPermanentNode* PermanentNode(BookmarkNode::Type type); |
| 260 |
256 // Sets/deletes meta info of |node|. | 261 // Sets/deletes meta info of |node|. |
257 void SetNodeMetaInfo(const BookmarkNode* node, | 262 void SetNodeMetaInfo(const BookmarkNode* node, |
258 const std::string& key, | 263 const std::string& key, |
259 const std::string& value); | 264 const std::string& value); |
260 void SetNodeMetaInfoMap(const BookmarkNode* node, | 265 void SetNodeMetaInfoMap(const BookmarkNode* node, |
261 const BookmarkNode::MetaInfoMap& meta_info_map); | 266 const BookmarkNode::MetaInfoMap& meta_info_map); |
262 void DeleteNodeMetaInfo(const BookmarkNode* node, | 267 void DeleteNodeMetaInfo(const BookmarkNode* node, |
263 const std::string& key); | 268 const std::string& key); |
264 | 269 |
265 // Sets the sync transaction version of |node|. | 270 // Sets the sync transaction version of |node|. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // Creates and returns a new BookmarkLoadDetails. It's up to the caller to | 370 // Creates and returns a new BookmarkLoadDetails. It's up to the caller to |
366 // delete the returned object. | 371 // delete the returned object. |
367 scoped_ptr<BookmarkLoadDetails> CreateLoadDetails( | 372 scoped_ptr<BookmarkLoadDetails> CreateLoadDetails( |
368 const std::string& accept_languages); | 373 const std::string& accept_languages); |
369 | 374 |
370 BookmarkClient* const client_; | 375 BookmarkClient* const client_; |
371 | 376 |
372 // Whether the initial set of data has been loaded. | 377 // Whether the initial set of data has been loaded. |
373 bool loaded_; | 378 bool loaded_; |
374 | 379 |
375 // The root node. This contains the bookmark bar node and the 'other' node as | 380 // The root node. This contains the bookmark bar node, the 'other' node and |
376 // children. | 381 // the mobile node as children. |
377 BookmarkNode root_; | 382 BookmarkNode root_; |
378 | 383 |
379 BookmarkPermanentNode* bookmark_bar_node_; | 384 BookmarkPermanentNode* bookmark_bar_node_; |
380 BookmarkPermanentNode* other_node_; | 385 BookmarkPermanentNode* other_node_; |
381 BookmarkPermanentNode* mobile_node_; | 386 BookmarkPermanentNode* mobile_node_; |
382 | 387 |
383 // The maximum ID assigned to the bookmark nodes in the model. | 388 // The maximum ID assigned to the bookmark nodes in the model. |
384 int64 next_node_id_; | 389 int64 next_node_id_; |
385 | 390 |
386 // The observers. | 391 // The observers. |
(...skipping 23 matching lines...) Expand all Loading... |
410 | 415 |
411 // See description of IsDoingExtensiveChanges above. | 416 // See description of IsDoingExtensiveChanges above. |
412 int extensive_changes_; | 417 int extensive_changes_; |
413 | 418 |
414 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 419 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
415 | 420 |
416 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 421 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
417 }; | 422 }; |
418 | 423 |
419 #endif // COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_MODEL_H_ | 424 #endif // COMPONENTS_BOOKMARKS_CORE_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |