| 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_TABLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // TableModel methods. | 39 // TableModel methods. |
| 40 virtual std::wstring GetText(int row, int column_id); | 40 virtual std::wstring GetText(int row, int column_id); |
| 41 virtual SkBitmap GetIcon(int row); | 41 virtual SkBitmap GetIcon(int row); |
| 42 virtual void SetObserver(views::TableModelObserver* observer) { | 42 virtual void SetObserver(views::TableModelObserver* observer) { |
| 43 observer_ = observer; | 43 observer_ = observer; |
| 44 } | 44 } |
| 45 | 45 |
| 46 // BookmarkModelObserver methods. | 46 // BookmarkModelObserver methods. |
| 47 virtual void Loaded(BookmarkModel* model) {} | 47 virtual void Loaded(BookmarkModel* model) {} |
| 48 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); | 48 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); |
| 49 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
| 50 BookmarkNode* node) {} |
| 51 |
| 49 | 52 |
| 50 // Returns the index of the specified node, or -1 if the node isn't in the | 53 // Returns the index of the specified node, or -1 if the node isn't in the |
| 51 // model. | 54 // model. |
| 52 virtual int IndexOfNode(BookmarkNode* node); | 55 virtual int IndexOfNode(BookmarkNode* node); |
| 53 | 56 |
| 54 // Returns the BookmarkNode at the specified index. | 57 // Returns the BookmarkNode at the specified index. |
| 55 virtual BookmarkNode* GetNodeForRow(int row) = 0; | 58 virtual BookmarkNode* GetNodeForRow(int row) = 0; |
| 56 | 59 |
| 57 // Returns the underlying BookmarkModel. | 60 // Returns the underlying BookmarkModel. |
| 58 BookmarkModel* model() const { return model_; } | 61 BookmarkModel* model() const { return model_; } |
| 59 | 62 |
| 60 protected: | 63 protected: |
| 61 views::TableModelObserver* observer() const { return observer_; } | 64 views::TableModelObserver* observer() const { return observer_; } |
| 62 | 65 |
| 63 private: | 66 private: |
| 64 // Builds the path shown in the path column for the specified node. | 67 // Builds the path shown in the path column for the specified node. |
| 65 void BuildPath(BookmarkNode* node, std::wstring* path); | 68 void BuildPath(BookmarkNode* node, std::wstring* path); |
| 66 | 69 |
| 67 BookmarkModel* model_; | 70 BookmarkModel* model_; |
| 68 views::TableModelObserver* observer_; | 71 views::TableModelObserver* observer_; |
| 69 | 72 |
| 70 DISALLOW_COPY_AND_ASSIGN(BookmarkTableModel); | 73 DISALLOW_COPY_AND_ASSIGN(BookmarkTableModel); |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_ | 76 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_ |
| OLD | NEW |