summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-18 10:10:57 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-18 10:10:57 +0000
commite713a43daff36ba4317c7585a1a6ea056f49cb8c (patch)
treeea313e6270c2cc5fb25e586dfa2627b9130f72b1 /chrome/browser/views
parentf90620fab94daecd80bba4d84341610b74bad49e (diff)
downloadchromium_src-e713a43daff36ba4317c7585a1a6ea056f49cb8c.zip
chromium_src-e713a43daff36ba4317c7585a1a6ea056f49cb8c.tar.gz
chromium_src-e713a43daff36ba4317c7585a1a6ea056f49cb8c.tar.bz2
A quick fix for Issue 37250.
Even though r15558 adjusted the position of a tabstrip in RTL languages, I'm afraid it did not adjust the position of an avator icon. This moves the tabstrip right by the size of the avatar icon in incognito mode and prevent rendering the new tab button. This change also adjusts the position of the avatar icon in RTL languages so we can get the correct position of the tabstrip in incognito mode as well. BUG=37250 TEST=Launch chrome.exe --lang=he --incognito; open twenty tabs, and; see if we can still see the new tab button. Review URL: http://codereview.chromium.org/2830011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc
index 953cfab..d65cbc3 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/views/frame/glass_browser_frame_view.cc
@@ -89,16 +89,20 @@ gfx::Rect GlassBrowserFrameView::GetBoundsForTabStrip(
int tabstrip_x = browser_view_->ShouldShowOffTheRecordAvatar() ?
(otr_avatar_bounds_.right() + kOTRSideSpacing) :
NonClientBorderThickness();
- // 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 (base::i18n::IsRTL())
- tabstrip_x += (width() - minimize_button_offset);
+ // In RTL languages, we have moved an avatar icon left by the size of window
+ // controls to prevent it from being rendered over them. So, we use its x
+ // position to move this tab strip left when maximized. Also, we can render
+ // a tab strip until the left end of this window without considering the size
+ // of window controls in RTL languages.
+ if (base::i18n::IsRTL()) {
+ if (!browser_view_->ShouldShowOffTheRecordAvatar() &&
+ frame_->GetWindow()->IsMaximized())
+ tabstrip_x += otr_avatar_bounds_.x();
+ minimize_button_offset = width();
+ }
int tabstrip_width = minimize_button_offset - tabstrip_x -
(frame_->GetWindow()->IsMaximized() ?
kNewTabCaptionMaximizedSpacing : kNewTabCaptionRestoredSpacing);
- if (base::i18n::IsRTL())
- tabstrip_width += tabstrip_x;
return gfx::Rect(tabstrip_x, NonClientTopBorderHeight(),
std::max(0, tabstrip_width),
tabstrip->GetPreferredHeight());
@@ -423,6 +427,12 @@ void GlassBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
void GlassBrowserFrameView::LayoutOTRAvatar() {
int otr_x = NonClientBorderThickness() + kOTRSideSpacing;
+ // Move this avatar icon by the size of window controls to prevent it from
+ // being rendered over them in RTL languages. This code also needs to adjust
+ // the width of a tab strip to avoid decreasing this size twice. (See the
+ // comment in GetBoundsForTabStrip().)
+ if (base::i18n::IsRTL())
+ otr_x += width() - frame_->GetMinimizeButtonOffset();
SkBitmap otr_avatar_icon = browser_view_->GetOTRAvatarIcon();
int otr_height = browser_view_->IsTabStripVisible() ?
otr_avatar_icon.height() : 0;