diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-30 03:47:26 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-30 03:47:26 +0000 |
commit | d8f16ae0347635889c104a48269805c01901fc05 (patch) | |
tree | 1deca02651c41be9b227acf6509d0a1f2daac5b9 /chrome/browser/views/frame | |
parent | d35d5c76b7d09200bab91116ac19ce2c40adcb18 (diff) | |
download | chromium_src-d8f16ae0347635889c104a48269805c01901fc05.zip chromium_src-d8f16ae0347635889c104a48269805c01901fc05.tar.gz chromium_src-d8f16ae0347635889c104a48269805c01901fc05.tar.bz2 |
Experiment with dislodging the Extension Shelf and having it only appear on the New Tab page.
BUG=http://crbug.com/20415
TEST=With the extension toolstrip visible, go to the New Tab page and press Ctrl + Alt + B. Watch the toolstrip merge into the New Tab page and back again into a separate toolstrip (when you press Ctrl + Alt + B again). Also, when you do this on a regular webpage (as opposed to NTP) this should toggle the toolstrip visiblity.
Review URL: http://codereview.chromium.org/175017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24864 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 30 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 8 |
2 files changed, 32 insertions, 6 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 6dc9adf..ae02466 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -655,6 +655,10 @@ void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) { } } +void BrowserView::SelectedTabExtensionShelfSizeChanged() { + Layout(); +} + void BrowserView::UpdateTitleBar() { frame_->GetWindow()->UpdateWindowTitle(); if (ShouldShowWindowIcon()) @@ -849,6 +853,10 @@ void BrowserView::ToggleBookmarkBar() { bookmark_utils::ToggleWhenVisible(browser_->profile()); } +void BrowserView::ToggleExtensionShelf() { + ExtensionShelf::ToggleWhenExtensionShelfVisible(browser_->profile()); +} + void BrowserView::ShowAboutChromeDialog() { browser::ShowAboutChromeView(GetWidget(), browser_->profile()); } @@ -1398,8 +1406,7 @@ void BrowserView::Layout() { int top = LayoutTabStrip(); top = LayoutToolbar(top); top = LayoutBookmarkAndInfoBars(top); - int bottom = LayoutExtensionShelf(); - bottom = LayoutDownloadShelf(bottom); + int bottom = LayoutExtensionAndDownloadShelves(); LayoutTabContents(top, bottom); // This must be done _after_ we lay out the TabContents since this code calls // back into us to find the bounding box the find bar must be laid out within, @@ -1611,6 +1618,22 @@ void BrowserView::LayoutTabContents(int top, int bottom) { contents_split_->SetBounds(0, top, width(), bottom - top); } +int BrowserView::LayoutExtensionAndDownloadShelves() { + // If we're showing the Bookmark bar in detached style, then we need to show + // any Info bar _above_ the Bookmark bar, since the Bookmark bar is styled + // to look like it's part of the page. + int bottom = height(); + if (extension_shelf_) { + if (extension_shelf_->IsDetachedStyle()) { + bottom = LayoutDownloadShelf(bottom); + return LayoutExtensionShelf(bottom); + } + // Otherwise, Extension shelf first, Download shelf second. + bottom = LayoutExtensionShelf(bottom); + } + return LayoutDownloadShelf(bottom); +} + int BrowserView::LayoutDownloadShelf(int bottom) { // Re-layout the shelf either if it is visible or if it's close animation // is currently running. @@ -1639,8 +1662,7 @@ void BrowserView::LayoutStatusBubble(int top) { status_bubble_->SetBounds(origin.x(), origin.y(), width() / 3, height); } -int BrowserView::LayoutExtensionShelf() { - int bottom = height(); +int BrowserView::LayoutExtensionShelf(int bottom) { if (extension_shelf_) { bool visible = browser_->SupportsWindowFeature( Browser::FEATURE_EXTENSIONSHELF); diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index d978c51..2fd3d4a 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -208,6 +208,7 @@ class BrowserView : public BrowserWindow, virtual BrowserWindowTesting* GetBrowserWindowTesting(); virtual StatusBubble* GetStatusBubble(); virtual void SelectedTabToolbarSizeChanged(bool is_animating); + virtual void SelectedTabExtensionShelfSizeChanged(); virtual void UpdateTitleBar(); virtual void UpdateDevTools(); virtual void FocusDevTools(); @@ -229,6 +230,7 @@ class BrowserView : public BrowserWindow, virtual void ConfirmAddSearchProvider(const TemplateURL* template_url, Profile* profile); virtual void ToggleBookmarkBar(); + virtual void ToggleExtensionShelf(); virtual void ShowAboutChromeDialog(); virtual void ShowTaskManager(); virtual void ShowBookmarkManager(); @@ -344,13 +346,15 @@ class BrowserView : public BrowserWindow, // Layout the TabContents container, between the coordinates |top| and // |bottom|. void LayoutTabContents(int top, int bottom); + int LayoutExtensionAndDownloadShelves(); + // Layout the Extension Shelf, returns the coordinate of the top of the + // control, for laying out the previous control. + int LayoutExtensionShelf(int bottom); // Layout the Download Shelf, returns the coordinate of the top of the // control, for laying out the previous control. int LayoutDownloadShelf(int bottom); // Layout the Status Bubble. void LayoutStatusBubble(int top); - // Layout the Extension Shelf - int LayoutExtensionShelf(); // Prepare to show the Bookmark Bar for the specified TabContents. Returns // true if the Bookmark Bar can be shown (i.e. it's supported for this |