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

Side by Side Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 3108027: Convert GetDisplayStringInLTRDirectionality from wstring to string16. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 // 1325 //
1326 // Currently, we use element's directionality as the tooltip direction hint. 1326 // Currently, we use element's directionality as the tooltip direction hint.
1327 // An alternate solution would be to set the overall directionality based on 1327 // An alternate solution would be to set the overall directionality based on
1328 // trying to detect the directionality from the tooltip text rather than the 1328 // trying to detect the directionality from the tooltip text rather than the
1329 // element direction. One could argue that would be a preferable solution 1329 // element direction. One could argue that would be a preferable solution
1330 // but we use the current approach to match Fx & IE's behavior. 1330 // but we use the current approach to match Fx & IE's behavior.
1331 std::wstring wrapped_tooltip_text = tooltip_text; 1331 std::wstring wrapped_tooltip_text = tooltip_text;
1332 if (!tooltip_text.empty()) { 1332 if (!tooltip_text.empty()) {
1333 if (text_direction_hint == WebKit::WebTextDirectionLeftToRight) { 1333 if (text_direction_hint == WebKit::WebTextDirectionLeftToRight) {
1334 // Force the tooltip to have LTR directionality. 1334 // Force the tooltip to have LTR directionality.
1335 base::i18n::GetDisplayStringInLTRDirectionality(&wrapped_tooltip_text); 1335 wrapped_tooltip_text = UTF16ToWide(
1336 base::i18n::GetDisplayStringInLTRDirectionality(
1337 WideToUTF16(wrapped_tooltip_text)));
1336 } else if (text_direction_hint == WebKit::WebTextDirectionRightToLeft && 1338 } else if (text_direction_hint == WebKit::WebTextDirectionRightToLeft &&
1337 !base::i18n::IsRTL()) { 1339 !base::i18n::IsRTL()) {
1338 // Force the tooltip to have RTL directionality. 1340 // Force the tooltip to have RTL directionality.
1339 base::i18n::WrapStringWithRTLFormatting(&wrapped_tooltip_text); 1341 base::i18n::WrapStringWithRTLFormatting(&wrapped_tooltip_text);
1340 } 1342 }
1341 } 1343 }
1342 if (view()) 1344 if (view())
1343 view()->SetTooltipText(wrapped_tooltip_text); 1345 view()->SetTooltipText(wrapped_tooltip_text);
1344 } 1346 }
1345 1347
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 RenderViewHostDelegate::ContentSettings* content_settings_delegate = 2022 RenderViewHostDelegate::ContentSettings* content_settings_delegate =
2021 delegate_->GetContentSettingsDelegate(); 2023 delegate_->GetContentSettingsDelegate();
2022 if (content_settings_delegate) 2024 if (content_settings_delegate)
2023 content_settings_delegate->OnWebDatabaseAccessed( 2025 content_settings_delegate->OnWebDatabaseAccessed(
2024 url, name, display_name, estimated_size, blocked_by_policy); 2026 url, name, display_name, estimated_size, blocked_by_policy);
2025 } 2027 }
2026 2028
2027 void RenderViewHost::OnSetDisplayingPDFContent() { 2029 void RenderViewHost::OnSetDisplayingPDFContent() {
2028 delegate_->SetDisplayingPDFContent(); 2030 delegate_->SetDisplayingPDFContent();
2029 } 2031 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698