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

Unified Diff: chrome/browser/ui/autofill/popup_controller_common.h

Issue 1151263002: Fix positioning of autofill popup on rtl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: chrome/browser/ui/autofill/popup_controller_common.h
diff --git a/chrome/browser/ui/autofill/popup_controller_common.h b/chrome/browser/ui/autofill/popup_controller_common.h
index 25341d433074167dafda3af9047203ef95e37f20..1eebfdbf7d87d3bf95104604310c7482941fbdf4 100644
--- a/chrome/browser/ui/autofill/popup_controller_common.h
+++ b/chrome/browser/ui/autofill/popup_controller_common.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_AUTOFILL_POPUP_CONTROLLER_COMMON_H_
#define CHROME_BROWSER_UI_AUTOFILL_POPUP_CONTROLLER_COMMON_H_
+#include "base/i18n/rtl.h"
#include "content/public/browser/render_widget_host.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
@@ -28,11 +29,13 @@ namespace autofill {
class PopupControllerCommon {
public:
PopupControllerCommon(const gfx::RectF& element_bounds,
+ base::i18n::TextDirection text_direction,
gfx::NativeView container_view,
content::WebContents* web_contents);
virtual ~PopupControllerCommon();
const gfx::RectF& element_bounds() const { return element_bounds_; }
+ bool is_rtl() const { return text_direction_ == base::i18n::RIGHT_TO_LEFT; }
gfx::NativeView container_view() { return container_view_; }
content::WebContents* web_contents() { return web_contents_; }
@@ -65,8 +68,6 @@ class PopupControllerCommon {
virtual gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const;
private:
- // Calculates the width of the popup and the x position of it. These values
- // will stay on the screen.
std::pair<int, int> CalculatePopupXAndWidth(
const gfx::Display& left_display,
const gfx::Display& right_display,
@@ -83,6 +84,9 @@ class PopupControllerCommon {
// These coordinates are in screen space.
gfx::RectF element_bounds_;
+ // The direction of the <input>.
+ base::i18n::TextDirection text_direction_;
+
// Weak reference
gfx::NativeView container_view_;

Powered by Google App Engine
This is Rietveld 408576698