diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-10 17:58:48 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-10 17:58:48 +0000 |
commit | a60c7ac21e326e6a9587ae6d114f3bb2eecaf2b2 (patch) | |
tree | 054bb01b993f803af1cd8ba7d7a99e54f4be162e /chrome/browser/gtk/bookmark_bar_gtk.h | |
parent | bb86b871359ba34fb15b15e7693315fd92c26486 (diff) | |
download | chromium_src-a60c7ac21e326e6a9587ae6d114f3bb2eecaf2b2.zip chromium_src-a60c7ac21e326e6a9587ae6d114f3bb2eecaf2b2.tar.gz chromium_src-a60c7ac21e326e6a9587ae6d114f3bb2eecaf2b2.tar.bz2 |
Fill in NOTIMPLEMENTEDs in BookmarkBarGtk. Can now reorder bookmarks.
Review URL: http://codereview.chromium.org/66022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13518 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.h')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.h | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h index 9b1a30f..d45fcdbb 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.h +++ b/chrome/browser/gtk/bookmark_bar_gtk.h @@ -15,7 +15,6 @@ class Browser; class CustomContainerButton; -class NineBox; class PageNavigator; class Profile; @@ -57,10 +56,22 @@ class BookmarkBarGtk : public BookmarkModelObserver { bool IsAlwaysShown(); private: - // Helper function which destroys all the bookmark buttons in - // |current_bookmark_buttons_|. + // Helper function that sets visual properties of GtkButton |button| to the + // contents of |node|. + void ConfigureButtonForNode(BookmarkNode* node, + GtkWidget* button); + + // Helper function which generates GtkToolItems for |bookmark_toolbar_|. + void CreateAllBookmarkButtons(BookmarkNode* node); + + // Helper function which destroys all the bookmark buttons in the GtkToolbar. void RemoveAllBookmarkButtons(); + // Returns the number of buttons corresponding to starred urls/groups. This + // is equivalent to the number of children the bookmark bar node from the + // bookmark bar model has. + int GetBookmarkButtonCount(); + // Overridden from BookmarkModelObserver: // Invoked when the bookmark bar model has finished loading. Creates a button @@ -68,46 +79,27 @@ class BookmarkBarGtk : public BookmarkModelObserver { virtual void Loaded(BookmarkModel* model); // Invoked when the model is being deleted. - virtual void BookmarkModelBeingDeleted(BookmarkModel* model) { - NOTIMPLEMENTED(); - } + virtual void BookmarkModelBeingDeleted(BookmarkModel* model); // Invoked when a node has moved. virtual void BookmarkNodeMoved(BookmarkModel* model, BookmarkNode* old_parent, int old_index, BookmarkNode* new_parent, - int new_index) { - NOTIMPLEMENTED(); - } - + int new_index); virtual void BookmarkNodeAdded(BookmarkModel* model, BookmarkNode* parent, - int index) { - NOTIMPLEMENTED(); - } - + int index); virtual void BookmarkNodeRemoved(BookmarkModel* model, BookmarkNode* parent, - int index) { - NOTIMPLEMENTED(); - } - + int index); virtual void BookmarkNodeChanged(BookmarkModel* model, - BookmarkNode* node) { - NOTIMPLEMENTED(); - } - + BookmarkNode* node); // Invoked when a favicon has finished loading. virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, - BookmarkNode* node) { - NOTIMPLEMENTED(); - } - + BookmarkNode* node); virtual void BookmarkNodeChildrenReordered(BookmarkModel* model, - BookmarkNode* node) { - NOTIMPLEMENTED(); - } + BookmarkNode* node); private: GtkWidget* CreateBookmarkButton(BookmarkNode* node); @@ -115,6 +107,12 @@ class BookmarkBarGtk : public BookmarkModelObserver { std::string BuildTooltip(BookmarkNode* node); + // Finds the BookmarkNode from the model associated with |button|. + BookmarkNode* GetNodeForToolButton(GtkWidget* button); + + // Creates and displays a popup menu for BookmarkNode |node|. + void PopupMenuForNode(BookmarkNode* node, GdkEventButton* event); + // GtkButton callbacks static gboolean OnButtonPressed(GtkWidget* sender, GdkEventButton* event, @@ -143,6 +141,12 @@ class BookmarkBarGtk : public BookmarkModelObserver { GdkDragContext* context, guint time, BookmarkBarGtk* bar); + static gboolean OnToolbarDragDrop(GtkWidget* toolbar, + GdkDragContext* drag_context, + gint x, + gint y, + guint time, + BookmarkBarGtk* bar); Profile* profile_; @@ -184,11 +188,6 @@ class BookmarkBarGtk : public BookmarkModelObserver { // Whether we should show the instructional text in the bookmark bar. bool show_instructions_; - - // The theme graphics for when the mouse is over the button. - scoped_ptr<NineBox> nine_box_prelight_; - // The theme graphics for when the button is clicked. - scoped_ptr<NineBox> nine_box_active_; }; #endif // CHROME_BROWSER_GTK_BOOKMARK_BAR_GTK_H_ |