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

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: Updated to correct coding style Created 6 years, 4 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 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1881 #if defined(OS_ANDROID) 1881 #if defined(OS_ANDROID)
1882 ipc_params.capture = params.useMediaCapture; 1882 ipc_params.capture = params.useMediaCapture;
1883 #endif 1883 #endif
1884 1884
1885 return ScheduleFileChooser(ipc_params, chooser_completion); 1885 return ScheduleFileChooser(ipc_params, chooser_completion);
1886 } 1886 }
1887 1887
1888 void RenderViewImpl::showValidationMessage( 1888 void RenderViewImpl::showValidationMessage(
1889 const blink::WebRect& anchor_in_root_view, 1889 const blink::WebRect& anchor_in_root_view,
1890 const blink::WebString& main_text, 1890 const blink::WebString& main_text,
1891 blink::WebTextDirection main_text_hint,
1891 const blink::WebString& sub_text, 1892 const blink::WebString& sub_text,
1892 blink::WebTextDirection hint) { 1893 blink::WebTextDirection sub_text_hint) {
1893 base::string16 wrapped_main_text = main_text; 1894 base::string16 wrapped_main_text = main_text;
1894 base::string16 wrapped_sub_text = sub_text; 1895 base::string16 wrapped_sub_text = sub_text;
1895 if (hint == blink::WebTextDirectionLeftToRight) { 1896 if (main_text_hint == blink::WebTextDirectionLeftToRight) {
1896 wrapped_main_text = 1897 wrapped_main_text =
1897 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text); 1898 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_main_text);
1898 if (!wrapped_sub_text.empty()) { 1899 } else if (main_text_hint == blink::WebTextDirectionRightToLeft
1900 && !base::i18n::IsRTL()) {
jam 2014/08/21 17:32:51 nit: indent 4 more here. also put "&&" at the star
Habib Virji 2014/08/26 08:55:44 Done.
1901 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text);
jam 2014/08/21 17:32:51 this should be a 2 space indent from the brace bra
Habib Virji 2014/08/26 08:55:44 Done.
1902 }
1903
1904 if (!wrapped_sub_text.empty()) {
1905 if (sub_text_hint == blink::WebTextDirectionLeftToRight) {
1899 wrapped_sub_text = 1906 wrapped_sub_text =
1900 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text); 1907 base::i18n::GetDisplayStringInLTRDirectionality(wrapped_sub_text);
jam 2014/08/21 17:32:51 4 space indent from wrapped and not 2
Habib Virji 2014/08/26 08:55:44 Done.
1901 } 1908 } else if (sub_text_hint == blink::WebTextDirectionRightToLeft) {
1902 } else if (hint == blink::WebTextDirectionRightToLeft
1903 && !base::i18n::IsRTL()) {
1904 base::i18n::WrapStringWithRTLFormatting(&wrapped_main_text);
1905 if (!wrapped_sub_text.empty()) {
1906 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text); 1909 base::i18n::WrapStringWithRTLFormatting(&wrapped_sub_text);
1907 } 1910 }
1908 } 1911 }
1909 Send(new ViewHostMsg_ShowValidationMessage( 1912 Send(new ViewHostMsg_ShowValidationMessage(
1910 routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view), 1913 routing_id(), AdjustValidationMessageAnchor(anchor_in_root_view),
1911 wrapped_main_text, wrapped_sub_text)); 1914 wrapped_main_text, wrapped_sub_text));
1912 } 1915 }
1913 1916
1914 void RenderViewImpl::hideValidationMessage() { 1917 void RenderViewImpl::hideValidationMessage() {
1915 Send(new ViewHostMsg_HideValidationMessage(routing_id())); 1918 Send(new ViewHostMsg_HideValidationMessage(routing_id()));
(...skipping 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after
4276 std::vector<gfx::Size> sizes; 4279 std::vector<gfx::Size> sizes;
4277 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4280 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4278 if (!url.isEmpty()) 4281 if (!url.isEmpty())
4279 urls.push_back( 4282 urls.push_back(
4280 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4283 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4281 } 4284 }
4282 SendUpdateFaviconURL(urls); 4285 SendUpdateFaviconURL(urls);
4283 } 4286 }
4284 4287
4285 } // namespace content 4288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698