diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.h | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/gtk/slide_animator_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/gtk/slide_animator_gtk.h | 3 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 2 |
6 files changed, 22 insertions, 12 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 8c83b40..abfe6d0 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -198,6 +198,14 @@ void BookmarkBarGtk::Hide() { gtk_widget_hide(bookmark_hbox_.get()); } +int BookmarkBarGtk::GetHeight() { + return bookmark_hbox_.get()->allocation.height; +} + +bool BookmarkBarGtk::IsClosing() { + return slide_animation_->IsClosing(); +} + bool BookmarkBarGtk::OnNewTabPage() { return (browser_ && browser_->GetSelectedTabContents() && browser_->GetSelectedTabContents()->IsBookmarkBarAlwaysVisible()); diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h index 30898e1..66bf3e0 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.h +++ b/chrome/browser/gtk/bookmark_bar_gtk.h @@ -25,7 +25,7 @@ class Profile; class BookmarkBarGtk : public AnimationDelegate, public BookmarkModelObserver { public: - explicit BookmarkBarGtk(Profile* proifle, Browser* browser); + explicit BookmarkBarGtk(Profile* profile, Browser* browser); virtual ~BookmarkBarGtk(); // Resets the profile. This removes any buttons for the current profile and @@ -57,6 +57,12 @@ class BookmarkBarGtk : public AnimationDelegate, void Show(); void Hide(); + // Get the current height of the bookmark bar. + int GetHeight(); + + // Returns true if the bookmark bar is showing the close animation. + bool IsClosing(); + // Returns true if the bookmarks bar preference is set to 'always show'. bool IsAlwaysShown(); diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index feea0fa..8cbf438 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -598,8 +598,10 @@ void BrowserWindowGtk::UserChangedTheme() { int BrowserWindowGtk::GetExtraRenderViewHeight() const { // The download shelf is controlled by its TabContents, so we don't have to // worry about it here. - // TODO(estade): take the bookmark bar into account as well. - return infobar_container_->TotalHeightOfClosingBars(); + int sum = infobar_container_->TotalHeightOfClosingBars(); + if (bookmark_bar_->IsClosing()) + sum += bookmark_bar_->GetHeight(); + return sum; } void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() { diff --git a/chrome/browser/gtk/slide_animator_gtk.cc b/chrome/browser/gtk/slide_animator_gtk.cc index dc2aa74..cea09b6 100644 --- a/chrome/browser/gtk/slide_animator_gtk.cc +++ b/chrome/browser/gtk/slide_animator_gtk.cc @@ -32,8 +32,7 @@ SlideAnimatorGtk::SlideAnimatorGtk(GtkWidget* child, : child_(child), direction_(direction), delegate_(delegate), - fixed_needs_resize_(false), - is_closing_(false) { + fixed_needs_resize_(false) { widget_.Own(gtk_fixed_new()); gtk_fixed_put(GTK_FIXED(widget_.get()), child, 0, 0); gtk_widget_set_size_request(widget_.get(), -1, 0); @@ -65,7 +64,6 @@ SlideAnimatorGtk::~SlideAnimatorGtk() { } void SlideAnimatorGtk::Open() { - is_closing_ = false; gtk_widget_show(widget_.get()); animation_->Show(); } @@ -86,7 +84,6 @@ void SlideAnimatorGtk::OpenWithoutAnimation() { } void SlideAnimatorGtk::Close() { - is_closing_ = true; animation_->Hide(); } @@ -102,7 +99,7 @@ bool SlideAnimatorGtk::IsShowing() { } bool SlideAnimatorGtk::IsClosing() { - return animation_->IsAnimating() && is_closing_; + return animation_->IsClosing(); } void SlideAnimatorGtk::AnimationProgressed(const Animation* animation) { diff --git a/chrome/browser/gtk/slide_animator_gtk.h b/chrome/browser/gtk/slide_animator_gtk.h index 3acc4f5..07d01f9 100644 --- a/chrome/browser/gtk/slide_animator_gtk.h +++ b/chrome/browser/gtk/slide_animator_gtk.h @@ -103,9 +103,6 @@ class SlideAnimatorGtk : public AnimationDelegate { // child widget has been allocated, at which point we will move it, and then // set this variable to false to indicate it should not be moved again. bool child_needs_move_; - - // Is true IFF Close() was called more recently than Open(). - bool is_closing_; }; #endif // CHROME_BROWSER_GTK_SLIDE_ANIMATOR_GTK_H_ diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index a67355e..465877f 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -174,7 +174,7 @@ class TabContentsDelegate { // Return much extra vertical space should be allotted to the // render view widget during various animations (e.g. infobar closing). // This is used to make painting look smoother. - virtual int GetExtraRenderViewHeight() { + virtual int GetExtraRenderViewHeight() const { return 0; } |