| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_SHIM_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_SHIM_H_ |
| 6 #define CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_SHIM_H_ | 6 #define CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_SHIM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 void RemoveObserver(Observer* observer); | 87 void RemoveObserver(Observer* observer); |
| 88 | 88 |
| 89 // PartnerBookmarksShim versions of BookmarkModel/BookmarkNode methods | 89 // PartnerBookmarksShim versions of BookmarkModel/BookmarkNode methods |
| 90 const bookmarks::BookmarkNode* GetNodeByID(int64_t id) const; | 90 const bookmarks::BookmarkNode* GetNodeByID(int64_t id) const; |
| 91 base::string16 GetTitle(const bookmarks::BookmarkNode* node) const; | 91 base::string16 GetTitle(const bookmarks::BookmarkNode* node) const; |
| 92 | 92 |
| 93 bool IsPartnerBookmark(const bookmarks::BookmarkNode* node) const; | 93 bool IsPartnerBookmark(const bookmarks::BookmarkNode* node) const; |
| 94 const bookmarks::BookmarkNode* GetPartnerBookmarksRoot() const; | 94 const bookmarks::BookmarkNode* GetPartnerBookmarksRoot() const; |
| 95 | 95 |
| 96 // Sets the root node of the partner bookmarks and notifies any observers that | 96 // Sets the root node of the partner bookmarks and notifies any observers that |
| 97 // the shim has now been loaded. Takes ownership of |root_node|. | 97 // the shim has now been loaded. |
| 98 void SetPartnerBookmarksRoot(bookmarks::BookmarkNode* root_node); | 98 void SetPartnerBookmarksRoot( |
| 99 std::unique_ptr<bookmarks::BookmarkNode> root_node); |
| 99 | 100 |
| 100 // Used as a "unique" identifier of the partner bookmark node for the purposes | 101 // Used as a "unique" identifier of the partner bookmark node for the purposes |
| 101 // of node deletion and title editing. Two bookmarks with the same URLs and | 102 // of node deletion and title editing. Two bookmarks with the same URLs and |
| 102 // titles are considered indistinguishable. | 103 // titles are considered indistinguishable. |
| 103 class NodeRenamingMapKey { | 104 class NodeRenamingMapKey { |
| 104 public: | 105 public: |
| 105 NodeRenamingMapKey(const GURL& url, const base::string16& provider_title); | 106 NodeRenamingMapKey(const GURL& url, const base::string16& provider_title); |
| 106 ~NodeRenamingMapKey(); | 107 ~NodeRenamingMapKey(); |
| 107 const GURL& url() const { return url_; } | 108 const GURL& url() const { return url_; } |
| 108 const base::string16& provider_title() const { return provider_title_; } | 109 const base::string16& provider_title() const { return provider_title_; } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 138 PrefService* prefs_; | 139 PrefService* prefs_; |
| 139 NodeRenamingMap node_rename_remove_map_; | 140 NodeRenamingMap node_rename_remove_map_; |
| 140 | 141 |
| 141 // The observers. | 142 // The observers. |
| 142 base::ObserverList<Observer> observers_; | 143 base::ObserverList<Observer> observers_; |
| 143 | 144 |
| 144 DISALLOW_COPY_AND_ASSIGN(PartnerBookmarksShim); | 145 DISALLOW_COPY_AND_ASSIGN(PartnerBookmarksShim); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 #endif // CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_SHIM_H_ | 148 #endif // CHROME_BROWSER_ANDROID_BOOKMARKS_PARTNER_BOOKMARKS_SHIM_H_ |
| OLD | NEW |