OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 #if defined(OS_ANDROID) | 1593 #if defined(OS_ANDROID) |
1594 ipc_params.capture = params.useMediaCapture; | 1594 ipc_params.capture = params.useMediaCapture; |
1595 #endif | 1595 #endif |
1596 | 1596 |
1597 return ScheduleFileChooser(ipc_params, chooser_completion); | 1597 return ScheduleFileChooser(ipc_params, chooser_completion); |
1598 } | 1598 } |
1599 | 1599 |
1600 void RenderViewImpl::showValidationMessage( | 1600 void RenderViewImpl::showValidationMessage( |
1601 const blink::WebRect& anchor_in_root_view, | 1601 const blink::WebRect& anchor_in_root_view, |
1602 const blink::WebString& main_text, | 1602 const blink::WebString& main_text, |
| 1603 blink::WebTextDirection main_text_hint, |
1603 const blink::WebString& sub_text, | 1604 const blink::WebString& sub_text, |
1604 blink::WebTextDirection hint) { | 1605 blink::WebTextDirection sub_text_hint) { |
1605 base::string16 wrapped_main_text = main_text; | 1606 base::string16 wrapped_main_text = main_text; |
1606 base::string16 wrapped_sub_text = sub_text; | 1607 base::string16 wrapped_sub_text = sub_text; |
1607 if (hint == blink::WebTextDirectionLeftToRight) { | 1608 if (main_text_hint == blink::WebTextDirectionLeftToRight) |
1608 wrapped_main_text = | 1609 wrapped_main_text = |
1609 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); | 1610 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
1610 if (!wrapped_sub_text.empty()) { | 1611 else if (main_text_hint == blink::WebTextDirectionRightToLeft |
| 1612 && !base::i18n::IsRTL()) |
| 1613 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); |
| 1614 |
| 1615 if (!wrapped_sub_text.empty()) { |
| 1616 if (sub_text_hint == blink::WebTextDirectionLeftToRight) |
1611 wrapped_sub_text = | 1617 wrapped_sub_text = |
1612 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); | 1618 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); |
1613 } | 1619 else if (sub_text_hint == blink::WebTextDirectionRightToLeft) |
1614 } else if (hint == blink::WebTextDirectionRightToLeft | |
1615 && !base::i18n::IsRTL()) { | |
1616 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); | |
1617 if (!wrapped_sub_text.empty()) { | |
1618 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); | 1620 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); |
1619 } | |
1620 } | 1621 } |
1621 Send(new ViewHostMsg_ShowValidationMessage( | 1622 Send(new ViewHostMsg_ShowValidationMessage( |
1622 routing_id(), anchor_in_root_view, wrapped_main_text, wrapped_sub_text)); | 1623 routing_id(), anchor_in_root_view, wrapped_main_text, wrapped_sub_text)); |
1623 } | 1624 } |
1624 | 1625 |
1625 void RenderViewImpl::hideValidationMessage() { | 1626 void RenderViewImpl::hideValidationMessage() { |
1626 Send(new ViewHostMsg_HideValidationMessage(routing_id())); | 1627 Send(new ViewHostMsg_HideValidationMessage(routing_id())); |
1627 } | 1628 } |
1628 | 1629 |
1629 void RenderViewImpl::moveValidationMessage( | 1630 void RenderViewImpl::moveValidationMessage( |
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 std::vector<gfx::Size> sizes; | 4014 std::vector<gfx::Size> sizes; |
4014 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4015 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4015 if (!url.isEmpty()) | 4016 if (!url.isEmpty()) |
4016 urls.push_back( | 4017 urls.push_back( |
4017 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4018 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4018 } | 4019 } |
4019 SendUpdateFaviconURL(urls); | 4020 SendUpdateFaviconURL(urls); |
4020 } | 4021 } |
4021 | 4022 |
4022 } // namespace content | 4023 } // namespace content |
OLD | NEW |