summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/bookmark_bar_gtk.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-16 23:31:37 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-16 23:31:37 +0000
commit9280528ce1f477d1564cf52eee4b2baaebaae7c5 (patch)
tree716a98b51984153592862e76e35fece25787cd29 /chrome/browser/gtk/bookmark_bar_gtk.cc
parentc8ec9dcc9f03ee29da9fbae2581fdc4b820e3649 (diff)
downloadchromium_src-9280528ce1f477d1564cf52eee4b2baaebaae7c5.zip
chromium_src-9280528ce1f477d1564cf52eee4b2baaebaae7c5.tar.gz
chromium_src-9280528ce1f477d1564cf52eee4b2baaebaae7c5.tar.bz2
GTK bookmark bar: only animate when user changes the pref (not, for example, on startup).
TEST=set bookmark bar open, restart chrome, bookmark bar should just be open (no animation) BUG=none Review URL: http://codereview.chromium.org/125223 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.cc')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index f4b1384..4982996 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -214,9 +214,14 @@ void BookmarkBarGtk::AddBookmarkbarToBox(GtkWidget* box) {
gtk_box_pack_start(GTK_BOX(box), bookmark_hbox_.get(), FALSE, FALSE, 0);
}
-void BookmarkBarGtk::Show() {
+void BookmarkBarGtk::Show(bool animate) {
gtk_widget_show_all(bookmark_hbox_.get());
- slide_animation_->Show();
+ if (animate) {
+ slide_animation_->Show();
+ } else {
+ slide_animation_->Reset(1);
+ AnimationProgressed(slide_animation_.get());
+ }
// Maybe show the instructions
if (show_instructions_) {
@@ -226,13 +231,16 @@ void BookmarkBarGtk::Show() {
}
}
-void BookmarkBarGtk::Hide() {
+void BookmarkBarGtk::Hide(bool animate) {
// Sometimes we get called without a matching call to open. If that happens
// then force hide.
- if (slide_animation_->IsShowing())
+ if (slide_animation_->IsShowing() && animate) {
slide_animation_->Hide();
- else
+ } else {
gtk_widget_hide(bookmark_hbox_.get());
+ slide_animation_->Reset(0);
+ AnimationProgressed(slide_animation_.get());
+ }
}
int BookmarkBarGtk::GetHeight() {