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_MODEL_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 6 #define COMPONENTS_BOOKMARKS_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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // are sent. |removed_urls| is populated with the urls which no longer have | 317 // are sent. |removed_urls| is populated with the urls which no longer have |
318 // any bookmarks associated with them. | 318 // any bookmarks associated with them. |
319 // This method should be called after acquiring |url_lock_|. | 319 // This method should be called after acquiring |url_lock_|. |
320 void RemoveNodeAndGetRemovedUrls(BookmarkNode* node, | 320 void RemoveNodeAndGetRemovedUrls(BookmarkNode* node, |
321 std::set<GURL>* removed_urls); | 321 std::set<GURL>* removed_urls); |
322 | 322 |
323 // Removes the node from its parent, sends notification, and deletes it. | 323 // Removes the node from its parent, sends notification, and deletes it. |
324 // type specifies how the node should be removed. | 324 // type specifies how the node should be removed. |
325 void RemoveAndDeleteNode(BookmarkNode* delete_me); | 325 void RemoveAndDeleteNode(BookmarkNode* delete_me); |
326 | 326 |
327 // Remove |node| from |nodes_ordered_by_url_set_|. | 327 // Remove |node| from |nodes_ordered_by_url_set_| and |index_|. |
328 void RemoveNodeFromURLSet(BookmarkNode* node); | 328 void RemoveNodeFromInternalMaps(BookmarkNode* node); |
329 | 329 |
330 // Adds the |node| at |parent| in the specified |index| and notifies its | 330 // Adds the |node| at |parent| in the specified |index| and notifies its |
331 // observers. | 331 // observers. |
332 BookmarkNode* AddNode(BookmarkNode* parent, | 332 BookmarkNode* AddNode(BookmarkNode* parent, |
333 int index, | 333 int index, |
334 BookmarkNode* node); | 334 BookmarkNode* node); |
335 | 335 |
| 336 // Adds the |node| to |nodes_ordered_by_url_set_| and |index_|. |
| 337 void AddNodeToInternalMaps(BookmarkNode* node); |
| 338 |
336 // Returns true if the parent and index are valid. | 339 // Returns true if the parent and index are valid. |
337 bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end); | 340 bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end); |
338 | 341 |
339 // Creates one of the possible permanent nodes (bookmark bar node, other node | 342 // Creates one of the possible permanent nodes (bookmark bar node, other node |
340 // and mobile node) from |type|. | 343 // and mobile node) from |type|. |
341 BookmarkPermanentNode* CreatePermanentNode(BookmarkNode::Type type); | 344 BookmarkPermanentNode* CreatePermanentNode(BookmarkNode::Type type); |
342 | 345 |
343 // Notification that a favicon has finished loading. If we can decode the | 346 // Notification that a favicon has finished loading. If we can decode the |
344 // favicon, FaviconLoaded is invoked. | 347 // favicon, FaviconLoaded is invoked. |
345 void OnFaviconDataAvailable( | 348 void OnFaviconDataAvailable( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 417 |
415 // See description of IsDoingExtensiveChanges above. | 418 // See description of IsDoingExtensiveChanges above. |
416 int extensive_changes_; | 419 int extensive_changes_; |
417 | 420 |
418 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; | 421 scoped_ptr<bookmarks::BookmarkExpandedStateTracker> expanded_state_tracker_; |
419 | 422 |
420 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 423 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
421 }; | 424 }; |
422 | 425 |
423 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 426 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |