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_; |
} |