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

Unified Diff: chrome/browser/views/status_bubble_views.cc

Issue 115461: Fixed StatusBubbleViews::AvoidMouse() to support the mirrored UI (RTL) mode.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/status_bubble_views.cc
===================================================================
--- chrome/browser/views/status_bubble_views.cc (revision 16972)
+++ chrome/browser/views/status_bubble_views.cc (working copy)
@@ -571,9 +571,15 @@
gfx::Point top_left;
views::RootView* root = frame_->GetRootView();
views::View::ConvertPointToScreen(root, &top_left);
+ int window_width = root->GetLocalBounds(true).width(); // border included.
// Get the cursor position relative to the popup.
- cursor_location.set_x(cursor_location.x() - (top_left.x() + position_.x()));
+ if (view_->UILayoutIsRightToLeft()) {
+ int top_right_x = top_left.x() + window_width;
+ cursor_location.set_x(top_right_x - cursor_location.x());
+ } else {
+ cursor_location.set_x(cursor_location.x() - (top_left.x() + position_.x()));
+ }
cursor_location.set_y(cursor_location.y() - (top_left.y() + position_.y()));
// If the mouse is in a position where we think it would move the
@@ -625,9 +631,8 @@
view_->SetStyle(StatusView::STYLE_STANDARD_RIGHT);
offset_ = 0;
- int root_width = root->GetLocalBounds(true).width(); // border included.
// Substract border width + bubble width.
- int right_position_x = root_width - (position_.x() + size_.width());
+ int right_position_x = window_width - (position_.x() + size_.width());
popup_->SetBounds(gfx::Rect(top_left.x() + right_position_x,
top_left.y() + position_.y(),
size_.width(), size_.height()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698