diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 08:53:27 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 08:53:27 +0000 |
commit | 2947e85d28d27f7897d780c5ed027bb63d1cdeb0 (patch) | |
tree | b2dbf8b5402339fadd2ead33fecc0f67621bb9cc /chrome | |
parent | 85dc574a87e75872525941732d02ef55075b95ed (diff) | |
download | chromium_src-2947e85d28d27f7897d780c5ed027bb63d1cdeb0.zip chromium_src-2947e85d28d27f7897d780c5ed027bb63d1cdeb0.tar.gz chromium_src-2947e85d28d27f7897d780c5ed027bb63d1cdeb0.tar.bz2 |
Handle Browser::FEATURE_TOOLBAR and Browser::FEATURE_LOCATIONBAR in browser_window_gtk. This change makes Dev Tools window look much nicer.
Review URL: http://codereview.chromium.org/113703
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 31 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 10 |
2 files changed, 39 insertions, 2 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 3a97c6c..6d1701d 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -352,6 +352,8 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) gtk_widget_show_all(window_vbox_); browser_->tabstrip_model()->AddObserver(this); + HideUnsupportedWindowFeatures(); + NotificationService* ns = NotificationService::current(); ns->AddObserver(this, NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, NotificationService::AllSources()); @@ -508,8 +510,7 @@ void BrowserWindowGtk::SetFullscreen(bool fullscreen) { } else { full_screen_ = false; gtk_window_unfullscreen(window_); - toolbar_->Show(); - tabstrip_->Show(); + ShowSupportedWindowFeatures(); } } @@ -806,3 +807,29 @@ void BrowserWindowGtk::ExecuteBrowserCommand(int id) { if (browser_->command_updater()->IsCommandEnabled(id)) browser_->ExecuteCommand(id); } + +void BrowserWindowGtk::ShowSupportedWindowFeatures() { + if (IsTabStripSupported()) + tabstrip_->Show(); + + if (IsToolbarSupported()) + toolbar_->Show(); +} + +void BrowserWindowGtk::HideUnsupportedWindowFeatures() { + if (!IsTabStripSupported()) + tabstrip_->Hide(); + + if (!IsToolbarSupported()) + toolbar_->Hide(); +} + +bool BrowserWindowGtk::IsTabStripSupported() { + return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); +} + +bool BrowserWindowGtk::IsToolbarSupported() { + return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || + browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); +} + diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index c54a120..8516c35 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -157,6 +157,16 @@ class BrowserWindowGtk : public BrowserWindow, // Callback for the loading animation(s) associated with this window. void LoadingAnimationCallback(); + // Shows UI elements for supported window features. + void ShowSupportedWindowFeatures(); + + // Hides UI elements for unsupported window features. + void HideUnsupportedWindowFeatures(); + + bool IsTabStripSupported(); + + bool IsToolbarSupported(); + gfx::Rect bounds_; GdkWindowState state_; |