summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-08 17:37:42 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-08 17:37:42 +0000
commit2d6e9ddb38b2ffb11855b29e122a0a3f79d1b13a (patch)
treec71473ee1366b5c2e3a1ee8fc654c01145160e86 /chrome/browser
parentf83f78d23b22fce4465781cb153791fd7ad46e93 (diff)
downloadchromium_src-2d6e9ddb38b2ffb11855b29e122a0a3f79d1b13a.zip
chromium_src-2d6e9ddb38b2ffb11855b29e122a0a3f79d1b13a.tar.gz
chromium_src-2d6e9ddb38b2ffb11855b29e122a0a3f79d1b13a.tar.bz2
Update the instructional text's visibility on bookmark add/remove events.
Review URL: http://codereview.chromium.org/114016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc10
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.h4
2 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index 3f500b6..ada9183 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -202,6 +202,8 @@ void BookmarkBarGtk::BookmarkNodeAdded(BookmarkModel* model,
gtk_toolbar_insert(GTK_TOOLBAR(bookmark_toolbar_.get()),
CreateBookmarkToolItem(parent->GetChild(index)),
index);
+
+ SetInstructionState(parent);
}
void BookmarkBarGtk::BookmarkNodeRemoved(BookmarkModel* model,
@@ -217,6 +219,8 @@ void BookmarkBarGtk::BookmarkNodeRemoved(BookmarkModel* model,
GTK_TOOLBAR(bookmark_toolbar_.get()), index));
gtk_container_remove(GTK_CONTAINER(bookmark_toolbar_.get()),
to_remove);
+
+ SetInstructionState(parent);
}
void BookmarkBarGtk::BookmarkNodeChanged(BookmarkModel* model,
@@ -256,7 +260,11 @@ void BookmarkBarGtk::CreateAllBookmarkButtons(BookmarkNode* node) {
gtk_toolbar_insert(GTK_TOOLBAR(bookmark_toolbar_.get()), item, -1);
}
- show_instructions_ = (node->GetChildCount() == 0);
+ SetInstructionState(node);
+}
+
+void BookmarkBarGtk::SetInstructionState(BookmarkNode* boomarks_bar_node) {
+ show_instructions_ = (boomarks_bar_node->GetChildCount() == 0);
if (show_instructions_) {
gtk_widget_show(instructions_);
} else {
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h
index 93608f8..697b55c 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.h
+++ b/chrome/browser/gtk/bookmark_bar_gtk.h
@@ -66,6 +66,10 @@ class BookmarkBarGtk : public BookmarkModelObserver {
// Helper function which generates GtkToolItems for |bookmark_toolbar_|.
void CreateAllBookmarkButtons(BookmarkNode* node);
+ // Sets the visibility of the instructional text based on whether there are
+ // any bookmarks in |node|. |node| is assumed to be the bookmarks bar node.
+ void SetInstructionState(BookmarkNode* boomarks_bar_node);
+
// Helper function which destroys all the bookmark buttons in the GtkToolbar.
void RemoveAllBookmarkButtons();