summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/browser_window_gtk.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 22:18:50 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 22:18:50 +0000
commit9521c61f5588480d8cd6134144db7137630f2529 (patch)
tree74c0458f3d5b3dedfac7baf68b7e440e8bd6b542 /chrome/browser/gtk/browser_window_gtk.cc
parent128740bbcd5abb0c75254e6eb57b46192c1f47d1 (diff)
downloadchromium_src-9521c61f5588480d8cd6134144db7137630f2529.zip
chromium_src-9521c61f5588480d8cd6134144db7137630f2529.tar.gz
chromium_src-9521c61f5588480d8cd6134144db7137630f2529.tar.bz2
Begin work on extension shelf for Linux.
For now it displays only a placeholder text, but knows when to display (it's connected to the ExtensionShelfModel). TEST=none http://crbug.com/16759 Review URL: http://codereview.chromium.org/159019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_window_gtk.cc')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index c4d5299..2505733 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -36,6 +36,7 @@
#include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h"
#include "chrome/browser/gtk/download_shelf_gtk.h"
#include "chrome/browser/gtk/edit_search_engine_dialog.h"
+#include "chrome/browser/gtk/extension_shelf_gtk.h"
#include "chrome/browser/gtk/find_bar_gtk.h"
#include "chrome/browser/gtk/go_button_gtk.h"
#include "chrome/browser/gtk/gtk_theme_provider.h"
@@ -647,10 +648,11 @@ void BrowserWindowGtk::SetFullscreen(bool fullscreen) {
UpdateCustomFrame();
if (fullscreen) {
- // These three balanced by ShowSupportedWindowFeatures().
+ // These four balanced by ShowSupportedWindowFeatures().
toolbar_->Hide();
tabstrip_->Hide();
bookmark_bar_->Hide(false);
+ extension_shelf_->Hide();
gtk_window_fullscreen(window_);
} else {
@@ -906,6 +908,10 @@ void BrowserWindowGtk::MaybeShowBookmarkBar(TabContents* contents,
}
}
+void BrowserWindowGtk::MaybeShowExtensionShelf() {
+ extension_shelf_->Show();
+}
+
void BrowserWindowGtk::UpdateDevToolsForContents(TabContents* contents) {
TabContents* old_devtools = devtools_container_->GetTabContents();
if (old_devtools)
@@ -1101,6 +1107,11 @@ void BrowserWindowGtk::InitWidgets() {
this));
bookmark_bar_->AddBookmarkbarToBox(content_vbox_);
+ extension_shelf_.reset(new ExtensionShelfGtk(browser()->profile(),
+ browser_.get()));
+ extension_shelf_->AddShelfToBox(content_vbox_);
+ MaybeShowExtensionShelf();
+
// This vbox surrounds the render area: find bar, info bars and render view.
// The reason is that this area as a whole needs to be grouped in its own
// GdkWindow hierarchy so that animations originating inside it (infobar,
@@ -1400,6 +1411,9 @@ void BrowserWindowGtk::ShowSupportedWindowFeatures() {
if (IsBookmarkBarSupported())
MaybeShowBookmarkBar(browser_->GetSelectedTabContents(), false);
+
+ if (IsExtensionShelfSupported())
+ MaybeShowExtensionShelf();
}
void BrowserWindowGtk::HideUnsupportedWindowFeatures() {
@@ -1411,6 +1425,9 @@ void BrowserWindowGtk::HideUnsupportedWindowFeatures() {
if (!IsBookmarkBarSupported())
bookmark_bar_->Hide(false);
+
+ if (!IsExtensionShelfSupported())
+ extension_shelf_->Hide();
}
bool BrowserWindowGtk::IsTabStripSupported() {
@@ -1426,6 +1443,10 @@ bool BrowserWindowGtk::IsBookmarkBarSupported() {
return browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR);
}
+bool BrowserWindowGtk::IsExtensionShelfSupported() {
+ return browser_->SupportsWindowFeature(Browser::FEATURE_EXTENSIONSHELF);
+}
+
bool BrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) {
if (!use_custom_frame_.GetValue())
return false;