Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 175017: Experiment with dislodging the Extension Shelf and having it only appear on t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 24842)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -655,6 +655,10 @@
}
}
+void BrowserView::SelectedTabExtensionShelfSizeChanged() {
+ Layout();
+}
+
void BrowserView::UpdateTitleBar() {
frame_->GetWindow()->UpdateWindowTitle();
if (ShouldShowWindowIcon())
@@ -849,6 +853,10 @@
bookmark_utils::ToggleWhenVisible(browser_->profile());
}
+void BrowserView::ToggleExtensionShelf() {
+ ExtensionShelf::ToggleWhenExtensionShelfVisible(browser_->profile());
+}
+
void BrowserView::ShowAboutChromeDialog() {
browser::ShowAboutChromeView(GetWidget(), browser_->profile());
}
@@ -1398,8 +1406,7 @@
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 @@
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 @@
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);
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | chrome/common/notification_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698