OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.TIT |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_ |
| 7 |
| 8 #include <gtk/gtk.h> |
| 9 |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 11 |
| 12 class BookmarkModel; |
| 13 class Profile; |
| 14 |
| 15 class BookmarkManagerGtk : public BookmarkModelObserver { |
| 16 public: |
| 17 virtual ~BookmarkManagerGtk(); |
| 18 |
| 19 Profile* profile() { return profile_; } |
| 20 |
| 21 // Show the node in the tree. |
| 22 static void SelectInTree(BookmarkNode* node); |
| 23 |
| 24 // Shows the bookmark manager. Only one bookmark manager exists. |
| 25 static void Show(Profile* profile); |
| 26 |
| 27 // BookmarkModelObserver implementation. |
| 28 virtual void Loaded(BookmarkModel* model); |
| 29 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); |
| 30 // TODO(estade): Implement these. |
| 31 virtual void BookmarkNodeMoved(BookmarkModel* model, |
| 32 BookmarkNode* old_parent, |
| 33 int old_index, |
| 34 BookmarkNode* new_parent, |
| 35 int new_index) {} |
| 36 virtual void BookmarkNodeAdded(BookmarkModel* model, |
| 37 BookmarkNode* parent, |
| 38 int index) {} |
| 39 virtual void BookmarkNodeRemoved(BookmarkModel* model, |
| 40 BookmarkNode* parent, |
| 41 int index) {} |
| 42 virtual void BookmarkNodeRemoved(BookmarkModel* model, |
| 43 BookmarkNode* parent, |
| 44 int old_index, |
| 45 BookmarkNode* node) {} |
| 46 virtual void BookmarkNodeChanged(BookmarkModel* model, |
| 47 BookmarkNode* node) {} |
| 48 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, |
| 49 BookmarkNode* node) {} |
| 50 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
| 51 BookmarkNode* node) {} |
| 52 |
| 53 private: |
| 54 explicit BookmarkManagerGtk(Profile* profile); |
| 55 |
| 56 void InitWidgets(); |
| 57 GtkWidget* MakeLeftPane(); |
| 58 GtkWidget* MakeRightPane(); |
| 59 |
| 60 // Pack the data from the bookmark model into the stores. This does not |
| 61 // create the stores, which is done in Make{Left,Right}Pane(). These should |
| 62 // only be called once (when the bookmark model is loaded). |
| 63 void BuildLeftStore(); |
| 64 void BuildRightStore(); |
| 65 |
| 66 GtkWidget* window_; |
| 67 Profile* profile_; |
| 68 BookmarkModel* model_; |
| 69 |
| 70 enum { |
| 71 RIGHT_PANE_TITLE, |
| 72 RIGHT_PANE_URL, |
| 73 RIGHT_PANE_NUM |
| 74 }; |
| 75 GtkTreeStore* left_store_; |
| 76 GtkListStore* right_store_; |
| 77 }; |
| 78 |
| 79 #endif // CHROME_BROWSER_GTK_BOOKMARK_MANAGER_GTK_H_ |
OLD | NEW |