summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 20:20:14 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 20:20:14 +0000
commit9c1a794e4b6c9d3ffca49889958ff381ecb82e32 (patch)
treec5cc3b92a3a36dbd80dc93c5672a7a3aeebef735 /chrome
parent05f986e64a1b3b1803c5213e57c08f10cfe1366b (diff)
downloadchromium_src-9c1a794e4b6c9d3ffca49889958ff381ecb82e32.zip
chromium_src-9c1a794e4b6c9d3ffca49889958ff381ecb82e32.tar.gz
chromium_src-9c1a794e4b6c9d3ffca49889958ff381ecb82e32.tar.bz2
GTK: Don't show bookmark bar remnants in fullscreen mode.
BUG=21742 Review URL: http://codereview.chromium.org/200124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc14
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.h9
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc2
3 files changed, 20 insertions, 5 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index 275b8e6..67207d2 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -43,8 +43,9 @@ namespace {
// The showing height of the bar.
const int kBookmarkBarHeight = 29;
-// The height of the bar when it is "hidden". It is never completely hidden
-// because even when it is closed it forms the bottom few pixels of the toolbar.
+// The height of the bar when it is "hidden". It is usually not completely
+// hidden because even when it is closed it forms the bottom few pixels of
+// the toolbar.
const int kBookmarkBarMinimumHeight = 4;
// Left-padding for the instructional text.
@@ -233,7 +234,7 @@ void BookmarkBarGtk::Init(Profile* profile) {
}
void BookmarkBarGtk::Show(bool animate) {
- gtk_widget_show_all(bookmark_hbox_);
+ gtk_widget_show_all(widget());
if (animate) {
slide_animation_->Show();
} else {
@@ -250,6 +251,9 @@ void BookmarkBarGtk::Show(bool animate) {
}
void BookmarkBarGtk::Hide(bool animate) {
+ // After coming out of fullscreen, the browser window sets the bookmark bar
+ // to the "hidden" state, which means we need to show our minimum height.
+ gtk_widget_show(widget());
// Sometimes we get called without a matching call to open. If that happens
// then force hide.
if (slide_animation_->IsShowing() && animate) {
@@ -261,6 +265,10 @@ void BookmarkBarGtk::Hide(bool animate) {
}
}
+void BookmarkBarGtk::EnterFullscreen() {
+ gtk_widget_hide(widget());
+}
+
int BookmarkBarGtk::GetHeight() {
return event_box_->allocation.height;
}
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.h b/chrome/browser/gtk/bookmark_bar_gtk.h
index c7cb22d..65c7d82 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.h
+++ b/chrome/browser/gtk/bookmark_bar_gtk.h
@@ -62,9 +62,16 @@ class BookmarkBarGtk : public AnimationDelegate,
bool OnNewTabPage();
// Change the visibility of the bookmarks bar. (Starts out hidden, per GTK's
- // default behaviour).
+ // default behaviour). There are three visiblity states:
+ //
+ // Showing - bookmark bar is fully visible.
+ // Hidden - bookmark bar is hidden except for a few pixels that give
+ // extra padding to the bottom of the toolbar. Buttons are not
+ // clickable.
+ // Fullscreen - bookmark bar is fully hidden.
void Show(bool animate);
void Hide(bool animate);
+ void EnterFullscreen();
// Get the current height of the bookmark bar.
int GetHeight();
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 74f349b..20d1570 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1374,7 +1374,7 @@ void BrowserWindowGtk::OnStateChanged(GdkWindowState state,
toolbar_->Hide();
tabstrip_->Hide();
if (IsBookmarkBarSupported())
- bookmark_bar_->Hide(false);
+ bookmark_bar_->EnterFullscreen();
} else {
UpdateCustomFrame();
ShowSupportedWindowFeatures();