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

Side by Side Diff: views/controls/label.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 "views/controls/label.h" 5 #include "views/controls/label.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 432
433 // An URLs is always treated as an LTR text and therefore we should 433 // An URLs is always treated as an LTR text and therefore we should
434 // explicitly mark it as such if the locale is RTL so that URLs containing 434 // explicitly mark it as such if the locale is RTL so that URLs containing
435 // Hebrew or Arabic characters are displayed correctly. 435 // Hebrew or Arabic characters are displayed correctly.
436 // 436 //
437 // Note that we don't check the View's UI layout setting in order to 437 // Note that we don't check the View's UI layout setting in order to
438 // determine whether or not to insert the special Unicode formatting 438 // determine whether or not to insert the special Unicode formatting
439 // characters. We use the locale settings because an URL is always treated 439 // characters. We use the locale settings because an URL is always treated
440 // as an LTR string, even if its containing view does not use an RTL UI 440 // as an LTR string, even if its containing view does not use an RTL UI
441 // layout. 441 // layout.
442 base::i18n::GetDisplayStringInLTRDirectionality(paint_text); 442 *paint_text = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality(
443 WideToUTF16(*paint_text)));
443 } else if (elide_in_middle_) { 444 } else if (elide_in_middle_) {
444 *paint_text = gfx::ElideText(text_, font_, width(), true); 445 *paint_text = gfx::ElideText(text_, font_, width(), true);
445 } else { 446 } else {
446 *paint_text = text_; 447 *paint_text = text_;
447 } 448 }
448 449
449 *text_bounds = GetTextBounds(); 450 *text_bounds = GetTextBounds();
450 *flags = ComputeMultiLineFlags(); 451 *flags = ComputeMultiLineFlags();
451 } 452 }
452 453
453 } // namespace views 454 } // namespace views
OLDNEW
« chrome/browser/tab_contents/tab_contents.cc ('K') | « chrome/browser/views/status_bubble_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698