Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 23e0b1d8215d38dbc9e9431d9eb3a1f6a2d07520..763607c1fdd7f31d0781117a9d553b7d129ff09c 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -1894,23 +1894,24 @@ bool RenderViewImpl::runFileChooser( |
void RenderViewImpl::showValidationMessage( |
const blink::WebRect& anchor_in_root_view, |
const blink::WebString& main_text, |
+ blink::WebTextDirection main_text_hint, |
const blink::WebString& sub_text, |
- blink::WebTextDirection hint) { |
+ blink::WebTextDirection sub_text_hint) { |
base::string16 wrapped_main_text = main_text; |
base::string16 wrapped_sub_text = sub_text; |
- if (hint == blink::WebTextDirectionLeftToRight) { |
+ if (main_text_hint == blink::WebTextDirectionLeftToRight) |
jam
2014/08/18 17:55:51
nit: don't remove the brace brackets here or below
Habib Virji
2014/08/20 09:15:55
Done.
|
wrapped_main_text = |
- base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
- if (!wrapped_sub_text.empty()) { |
+ base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
+ else if (main_text_hint == blink::WebTextDirectionRightToLeft |
+ && !base::i18n::IsRTL()) |
+ base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); |
+ |
+ if (!wrapped_sub_text.empty()) { |
+ if (sub_text_hint == blink::WebTextDirectionLeftToRight) |
wrapped_sub_text = |
- base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); |
- } |
- } else if (hint == blink::WebTextDirectionRightToLeft |
- && !base::i18n::IsRTL()) { |
- base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); |
- if (!wrapped_sub_text.empty()) { |
+ base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); |
+ else if (sub_text_hint == blink::WebTextDirectionRightToLeft) |
base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); |
- } |
} |
Send(new ViewHostMsg_ShowValidationMessage( |
routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view), |