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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 391923006: Extra parameter to pass sub-message direction for validation message (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compilation fix for Windows Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 #if defined(OS_ANDROID) 1806 #if defined(OS_ANDROID)
1807 ipc_params.capture = params.useMediaCapture; 1807 ipc_params.capture = params.useMediaCapture;
1808 #endif 1808 #endif
1809 1809
1810 return ScheduleFileChooser(ipc_params, chooser_completion); 1810 return ScheduleFileChooser(ipc_params, chooser_completion);
1811 } 1811 }
1812 1812
1813 void RenderViewImpl::showValidationMessage( 1813 void RenderViewImpl::showValidationMessage(
1814 const blink::WebRect& anchor_in_root_view, 1814 const blink::WebRect& anchor_in_root_view,
1815 const blink::WebString& main_text, 1815 const blink::WebString& main_text,
1816 blink::WebTextDirection main_text_hint,
1816 const blink::WebString& sub_text, 1817 const blink::WebString& sub_text,
1817 blink::WebTextDirection hint) { 1818 blink::WebTextDirection sub_text_hint) {
1818 base::string16 wrapped_main_text = main_text; 1819 base::string16 wrapped_main_text = main_text;
1819 base::string16 wrapped_sub_text = sub_text; 1820 base::string16 wrapped_sub_text = sub_text;
1820 if (hint == blink::WebTextDirectionLeftToRight) { 1821 if (main_text_hint == blink::WebTextDirectionLeftToRight) {
1821 wrapped_main_text = 1822 wrapped_main_text =
1822 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); 1823 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text);
1823 if (!wrapped_sub_text.empty()) { 1824 } else if (main_text_hint == blink::WebTextDirectionRightToLeft &&
1825 !base::i18n::IsRTL()) {
1826 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text);
1827 }
1828
1829 if (!wrapped_sub_text.empty()) {
1830 if (sub_text_hint == blink::WebTextDirectionLeftToRight) {
1824 wrapped_sub_text = 1831 wrapped_sub_text =
1825 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); 1832 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text);
1826 } 1833 } else if (sub_text_hint == blink::WebTextDirectionRightToLeft) {
1827 } else if (hint == blink::WebTextDirectionRightToLeft
1828 && !base::i18n::IsRTL()) {
1829 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text);
1830 if (!wrapped_sub_text.empty()) {
1831 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); 1834 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text);
1832 } 1835 }
1833 } 1836 }
1834 Send(new ViewHostMsg_ShowValidationMessage( 1837 Send(new ViewHostMsg_ShowValidationMessage(
1835 routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view), 1838 routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view),
1836 wrapped_main_text, wrapped_sub_text)); 1839 wrapped_main_text, wrapped_sub_text));
1837 } 1840 }
1838 1841
1839 void RenderViewImpl::hideValidationMessage() { 1842 void RenderViewImpl::hideValidationMessage() {
1840 Send(new ViewHostMsg_HideValidationMessage(routing_id())); 1843 Send(new ViewHostMsg_HideValidationMessage(routing_id()));
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after
4201 std::vector<gfx::Size> sizes; 4204 std::vector<gfx::Size> sizes;
4202 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4205 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4203 if (!url.isEmpty()) 4206 if (!url.isEmpty())
4204 urls.push_back( 4207 urls.push_back(
4205 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4208 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4206 } 4209 }
4207 SendUpdateFaviconURL(urls); 4210 SendUpdateFaviconURL(urls);
4208 } 4211 }
4209 4212
4210 } // namespace content 4213 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698