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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 15769018: [Autofill] Determine Popup RTLness from page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android compile Created 7 years, 6 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/autofill_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
index b87fb40ab8210b5663cb6ea94365de11aefa9f09..d6a559621613a39d3820628a2825949ed3b1aea3 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -72,7 +72,8 @@ WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetOrCreate(
WeakPtr<AutofillPopupControllerImpl> previous,
WeakPtr<AutofillPopupDelegate> delegate,
gfx::NativeView container_view,
- const gfx::RectF& element_bounds) {
+ const gfx::RectF& element_bounds,
+ base::i18n::TextDirection text_direction) {
DCHECK(!previous.get() || previous->delegate_.get() == delegate.get());
if (previous.get() && previous->container_view() == container_view &&
@@ -85,18 +86,21 @@ WeakPtr<AutofillPopupControllerImpl> AutofillPopupControllerImpl::GetOrCreate(
previous->Hide();
AutofillPopupControllerImpl* controller =
- new AutofillPopupControllerImpl(delegate, container_view, element_bounds);
+ new AutofillPopupControllerImpl(
+ delegate, container_view, element_bounds, text_direction);
return controller->GetWeakPtr();
}
AutofillPopupControllerImpl::AutofillPopupControllerImpl(
base::WeakPtr<AutofillPopupDelegate> delegate,
gfx::NativeView container_view,
- const gfx::RectF& element_bounds)
+ const gfx::RectF& element_bounds,
+ base::i18n::TextDirection text_direction)
: view_(NULL),
delegate_(delegate),
container_view_(container_view),
element_bounds_(element_bounds),
+ text_direction_(text_direction),
weak_ptr_factory_(this) {
ClearState();
#if !defined(OS_ANDROID)
@@ -296,6 +300,10 @@ const gfx::RectF& AutofillPopupControllerImpl::element_bounds() const {
return element_bounds_;
}
+bool AutofillPopupControllerImpl::IsRTL() const {
+ return text_direction_ == base::i18n::RIGHT_TO_LEFT;
+}
+
const std::vector<string16>& AutofillPopupControllerImpl::names() const {
return names_;
}

Powered by Google App Engine
This is Rietveld 408576698