summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame/glass_browser_frame_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 18:09:08 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-07 18:09:08 +0000
commit7d3537dbac73e4361210d340b1ff210554c1e809 (patch)
tree3403569da99dd6e5e28020e184a1d43f12c51268 /chrome/browser/views/frame/glass_browser_frame_view.cc
parent0b8a5349d939bc0d05b9b53547f033ee5f0be02a (diff)
downloadchromium_src-7d3537dbac73e4361210d340b1ff210554c1e809.zip
chromium_src-7d3537dbac73e4361210d340b1ff210554c1e809.tar.gz
chromium_src-7d3537dbac73e4361210d340b1ff210554c1e809.tar.bz2
Adjust the position of the tabstrip to leave space for window controls in RTL languages.
http://crbug.com/11223 Review URL: http://codereview.chromium.org/115091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/glass_browser_frame_view.cc')
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc
index e274437..49488ba 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/views/frame/glass_browser_frame_view.cc
@@ -127,12 +127,20 @@ GlassBrowserFrameView::~GlassBrowserFrameView() {
gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
TabStrip* tabstrip) const {
+ int minimize_button_offset = frame_->GetMinimizeButtonOffset();
int tabstrip_x = browser_view_->ShouldShowOffTheRecordAvatar() ?
(otr_avatar_bounds_.right() + kOTRSideSpacing) :
NonClientBorderThickness();
- int tabstrip_width = frame_->GetMinimizeButtonOffset() - tabstrip_x -
- (frame_->IsMaximized() ?
- kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing);
+ // minimize_button_offset assumes LTR layout since the window controls
+ // themselves are not flipped, so we need to adjust the tabstrip's x
+ // position for them in RTL languages.
+ if (UILayoutIsRightToLeft())
+ tabstrip_x += (width() - minimize_button_offset);
+ int tabstrip_width = minimize_button_offset - tabstrip_x -
+ (frame_->IsMaximized() ? kNewTabCaptionMaximizedSpacing
+ : kNewTabCaptionRestoredSpacing);
+ if (UILayoutIsRightToLeft())
+ tabstrip_width += tabstrip_x;
return gfx::Rect(tabstrip_x, NonClientTopBorderHeight(),
std::max(0, tabstrip_width), tabstrip->GetPreferredHeight());
}