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 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1887 #if defined(OS_ANDROID) | 1887 #if defined(OS_ANDROID) |
1888 ipc_params.capture = params.useMediaCapture; | 1888 ipc_params.capture = params.useMediaCapture; |
1889 #endif | 1889 #endif |
1890 | 1890 |
1891 return ScheduleFileChooser(ipc_params, chooser_completion); | 1891 return ScheduleFileChooser(ipc_params, chooser_completion); |
1892 } | 1892 } |
1893 | 1893 |
1894 void RenderViewImpl::showValidationMessage( | 1894 void RenderViewImpl::showValidationMessage( |
1895 const blink::WebRect& anchor_in_root_view, | 1895 const blink::WebRect& anchor_in_root_view, |
1896 const blink::WebString& main_text, | 1896 const blink::WebString& main_text, |
1897 blink::WebTextDirection main_text_hint, | |
1897 const blink::WebString& sub_text, | 1898 const blink::WebString& sub_text, |
1898 blink::WebTextDirection hint) { | 1899 blink::WebTextDirection sub_text_hint) { |
1899 base::string16 wrapped_main_text = main_text; | 1900 base::string16 wrapped_main_text = main_text; |
1900 base::string16 wrapped_sub_text = sub_text; | 1901 base::string16 wrapped_sub_text = sub_text; |
1901 if (hint == blink::WebTextDirectionLeftToRight) { | 1902 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.
| |
1902 wrapped_main_text = | 1903 wrapped_main_text = |
1903 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); | 1904 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); |
1904 if (!wrapped_sub_text.empty()) { | 1905 else if (main_text_hint == blink::WebTextDirectionRightToLeft |
1906 && !base::i18n::IsRTL()) | |
1907 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); | |
1908 | |
1909 if (!wrapped_sub_text.empty()) { | |
1910 if (sub_text_hint == blink::WebTextDirectionLeftToRight) | |
1905 wrapped_sub_text = | 1911 wrapped_sub_text = |
1906 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); | 1912 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); |
1907 } | 1913 else if (sub_text_hint == blink::WebTextDirectionRightToLeft) |
1908 } else if (hint == blink::WebTextDirectionRightToLeft | |
1909 && !base::i18n::IsRTL()) { | |
1910 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text); | |
1911 if (!wrapped_sub_text.empty()) { | |
1912 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); | 1914 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); |
1913 } | |
1914 } | 1915 } |
1915 Send(new ViewHostMsg_ShowValidationMessage( | 1916 Send(new ViewHostMsg_ShowValidationMessage( |
1916 routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view), | 1917 routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view), |
1917 wrapped_main_text, wrapped_sub_text)); | 1918 wrapped_main_text, wrapped_sub_text)); |
1918 } | 1919 } |
1919 | 1920 |
1920 void RenderViewImpl::hideValidationMessage() { | 1921 void RenderViewImpl::hideValidationMessage() { |
1921 Send(new ViewHostMsg_HideValidationMessage(routing_id())); | 1922 Send(new ViewHostMsg_HideValidationMessage(routing_id())); |
1922 } | 1923 } |
1923 | 1924 |
(...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4287 std::vector<gfx::Size> sizes; | 4288 std::vector<gfx::Size> sizes; |
4288 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4289 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4289 if (!url.isEmpty()) | 4290 if (!url.isEmpty()) |
4290 urls.push_back( | 4291 urls.push_back( |
4291 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4292 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4292 } | 4293 } |
4293 SendUpdateFaviconURL(urls); | 4294 SendUpdateFaviconURL(urls); |
4294 } | 4295 } |
4295 | 4296 |
4296 } // namespace content | 4297 } // namespace content |
OLD | NEW |