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

Unified Diff: chrome/browser/ui/views/frame/browser_view_layout.cc

Issue 10388156: Adding the flip windows button to the browser window (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/ui/views/frame/browser_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_view_layout.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_view_layout.cc (revision 137335)
+++ chrome/browser/ui/views/frame/browser_view_layout.cc (working copy)
@@ -32,6 +32,8 @@
// The number of pixels the bookmark bar should overlap the spacer by if the
// spacer is visible.
const int kSpacerBookmarkBarOverlap = 1;
+// The number of pixels the metro switcher is offset from the right edge.
+const int kWindowSwitcherOffsetX = 5;
// Combines View::ConvertPointToView and View::HitTest for a given |point|.
// Converts |point| from |src| to |dst| and hit tests it against |dst|. The
@@ -297,7 +299,6 @@
tabstrip_->SetBounds(0, 0, 0, 0);
return 0;
}
-
// This retrieves the bounds for the tab strip based on whether or not we show
// anything to the left of it, like the incognito avatar.
gfx::Rect tabstrip_bounds(
@@ -309,7 +310,21 @@
tabstrip_->SetVisible(true);
tabstrip_->SetBoundsRect(tabstrip_bounds);
- return tabstrip_bounds.bottom();
+ int bottom = tabstrip_bounds.bottom();
+
+ // The metro window switcher sits at the far right edge of the tabstrip
+ // a |kWindowSwitcherOffsetY| pixels above the base of the tabstrip.
+ views::Button* switcher_button = browser_view_->window_switcher_button_;
+ if (switcher_button) {
+ int width = browser_view_->width();
+ gfx::Size ps = switcher_button->GetPreferredSize();
+ if (width > ps.width()) {
+ switcher_button->SetBounds(width - ps.width() - kWindowSwitcherOffsetX, 0,
+ ps.width(), ps.height());
+ }
+ }
+
+ return bottom;
}
int BrowserViewLayout::LayoutToolbar(int top) {
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698