summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 09:03:05 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 09:03:05 +0000
commit0603ca9446a35ccfd1ee56c2636c225e1c18fddb (patch)
tree6a67446bc06132dfce366d179cb54dc09016d0a1 /chrome/browser/ui/views
parente93d2f8b00c19b3edc0345e31ea592e8d4d432da (diff)
downloadchromium_src-0603ca9446a35ccfd1ee56c2636c225e1c18fddb.zip
chromium_src-0603ca9446a35ccfd1ee56c2636c225e1c18fddb.tar.gz
chromium_src-0603ca9446a35ccfd1ee56c2636c225e1c18fddb.tar.bz2
Aura: Fix tab strip showing under status area in compact mode
Also fixes status area position in RTL languages BUG=111537 TEST=Run Chrome OS in English with lots of tabs then lock and unlock screen, also try RTL language like Hebrew Review URL: http://codereview.chromium.org/9271088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/frame/browser_frame.cc35
1 files changed, 20 insertions, 15 deletions
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc
index b573e1d..e68749d 100644
--- a/chrome/browser/ui/views/frame/browser_frame.cc
+++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/views/frame/browser_frame.h"
#include "base/command_line.h"
+#include "base/i18n/rtl.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -100,27 +101,31 @@ gfx::Rect BrowserFrame::GetBoundsForTabStrip(views::View* tabstrip) const {
gfx::Rect tab_strip_bounds =
browser_frame_view_->GetBoundsForTabStrip(tabstrip);
#if defined(USE_AURA)
- // Leave space for status area when maximized under aura compact window mode.
+ // Leave space for status area in Aura compact window mode.
if (ash::Shell::GetInstance()->IsWindowModeCompact() &&
- IsMaximized() &&
ChromeShellDelegate::instance()) {
StatusAreaView* status_area =
ChromeShellDelegate::instance()->GetStatusArea();
if (status_area) {
- gfx::Rect status_rect = status_area->GetWidget()->GetWindowScreenBounds();
-
- // Translate status_rect to frame view coordinates.
- gfx::Point frame_origin = GetWindowScreenBounds().origin();
- gfx::Point frame_view_origin = browser_frame_view_->bounds().origin();
- status_rect.Offset(-(frame_origin.x() + frame_view_origin.x()),
- -(frame_origin.y() + frame_view_origin.y()));
-
- if (status_rect.Intersects(tab_strip_bounds)) {
- status_rect.set_y(tab_strip_bounds.y());
- status_rect.set_height(tab_strip_bounds.height());
-
- tab_strip_bounds = tab_strip_bounds.Subtract(status_rect);
+ int reserve_width = 0;
+ gfx::Rect screen_bounds = gfx::Screen::GetPrimaryMonitorBounds();
+ if (base::i18n::IsRTL()) {
+ // Get top-right corner of status area in screen coordinates.
+ gfx::Point status_origin(status_area->bounds().right(), 0);
+ views::View::ConvertPointToScreen(status_area, &status_origin);
+ // Reserve the width between the left edge of screen and the right edge
+ // of status area.
+ reserve_width = status_origin.x() - screen_bounds.x();
+ } else {
+ // Get top-left corner of status area in screen coordinates.
+ gfx::Point status_origin;
+ views::View::ConvertPointToScreen(status_area, &status_origin);
+ // Reserve the width between the right edge of screen and the left edge
+ // of status area.
+ reserve_width = screen_bounds.right() - status_origin.x();
}
+ // Views handles the RTL adjustment of tab strip.
+ tab_strip_bounds.set_width(tab_strip_bounds.width() - reserve_width);
}
}
#endif