| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BOOKMARKS_BOOKMARK_BAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_BAR_MODEL_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_BAR_MODEL_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_BAR_MODEL_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include "base/lock.h" | 10 #include "base/lock.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 BookmarkNodeRemoved(model, parent, old_index); | 162 BookmarkNodeRemoved(model, parent, old_index); |
| 163 } | 163 } |
| 164 | 164 |
| 165 // Invoked when the title or favicon of a node has changed. | 165 // Invoked when the title or favicon of a node has changed. |
| 166 virtual void BookmarkNodeChanged(BookmarkModel* model, | 166 virtual void BookmarkNodeChanged(BookmarkModel* model, |
| 167 BookmarkNode* node) = 0; | 167 BookmarkNode* node) = 0; |
| 168 | 168 |
| 169 // Invoked when a favicon has finished loading. | 169 // Invoked when a favicon has finished loading. |
| 170 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 170 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
| 171 BookmarkNode* node) = 0; | 171 BookmarkNode* node) = 0; |
| 172 |
| 173 // Invoked when the children (just direct children, not descendants) of |
| 174 // |node| have been reordered in some way, such as sorted. |
| 175 // TODO(sky): make this pure virtual when all observers have been updated. |
| 176 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
| 177 BookmarkNode* node) {} |
| 172 }; | 178 }; |
| 173 | 179 |
| 174 // BookmarkModel -------------------------------------------------------------- | 180 // BookmarkModel -------------------------------------------------------------- |
| 175 | 181 |
| 176 // BookmarkModel provides a directed acyclic graph of the starred entries | 182 // BookmarkModel provides a directed acyclic graph of the starred entries |
| 177 // and groups. Two graphs are provided for the two entry points: those on | 183 // and groups. Two graphs are provided for the two entry points: those on |
| 178 // the bookmark bar, and those in the other folder. | 184 // the bookmark bar, and those in the other folder. |
| 179 // | 185 // |
| 180 // An observer may be attached to observer relevant events. | 186 // An observer may be attached to observer relevant events. |
| 181 // | 187 // |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 const std::wstring& title, | 269 const std::wstring& title, |
| 264 const GURL& url); | 270 const GURL& url); |
| 265 | 271 |
| 266 // Adds a url with a specific creation date. | 272 // Adds a url with a specific creation date. |
| 267 BookmarkNode* AddURLWithCreationTime(BookmarkNode* parent, | 273 BookmarkNode* AddURLWithCreationTime(BookmarkNode* parent, |
| 268 int index, | 274 int index, |
| 269 const std::wstring& title, | 275 const std::wstring& title, |
| 270 const GURL& url, | 276 const GURL& url, |
| 271 const base::Time& creation_time); | 277 const base::Time& creation_time); |
| 272 | 278 |
| 279 // Sorts the children of |parent|, notifying observers by way of the |
| 280 // BookmarkNodeChildrenReordered method. |
| 281 void SortChildren(BookmarkNode* parent); |
| 282 |
| 273 // This is the convenience that makes sure the url is starred or not starred. | 283 // This is the convenience that makes sure the url is starred or not starred. |
| 274 // If is_starred is false, all bookmarks for URL are removed. If is_starred is | 284 // If is_starred is false, all bookmarks for URL are removed. If is_starred is |
| 275 // true and there are no bookmarks for url, a bookmark is created. | 285 // true and there are no bookmarks for url, a bookmark is created. |
| 276 void SetURLStarred(const GURL& url, | 286 void SetURLStarred(const GURL& url, |
| 277 const std::wstring& title, | 287 const std::wstring& title, |
| 278 bool is_starred); | 288 bool is_starred); |
| 279 | 289 |
| 280 // Resets the 'date modified' time of the node to 0. This is used during | 290 // Resets the 'date modified' time of the node to 0. This is used during |
| 281 // importing to exclude the newly created groups from showing up in the | 291 // importing to exclude the newly created groups from showing up in the |
| 282 // combobox of most recently modified groups. | 292 // combobox of most recently modified groups. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 // TODO(port): Implement for other platforms. | 435 // TODO(port): Implement for other platforms. |
| 426 | 436 |
| 427 // Handle to event signaled when loading is done. | 437 // Handle to event signaled when loading is done. |
| 428 ScopedHandle loaded_signal_; | 438 ScopedHandle loaded_signal_; |
| 429 #endif | 439 #endif |
| 430 | 440 |
| 431 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 441 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
| 432 }; | 442 }; |
| 433 | 443 |
| 434 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_BAR_MODEL_H_ | 444 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_BAR_MODEL_H_ |
| OLD | NEW |