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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 10695101: Remove code that forces text directionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove directionality forcing and modes; may be incorrect... Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/canvas.h » ('j') | ui/views/controls/label.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <atlbase.h> // NOLINT 8 #include <atlbase.h> // NOLINT
9 #include <atlwin.h> // NOLINT 9 #include <atlwin.h> // NOLINT
10 #endif 10 #endif
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 break; 433 break;
434 } 434 }
435 remaining_width -= i->pixel_width; 435 remaining_width -= i->pixel_width;
436 } 436 }
437 437
438 // Sort back into visual order so we can display the runs correctly. 438 // Sort back into visual order so we can display the runs correctly.
439 std::sort(runs.begin(), runs.end(), &SortRunsVisually); 439 std::sort(runs.begin(), runs.end(), &SortRunsVisually);
440 440
441 // Draw the runs. 441 // Draw the runs.
442 for (Runs::iterator i(runs.begin()); i != runs.end(); ++i) { 442 for (Runs::iterator i(runs.begin()); i != runs.end(); ++i) {
443 const bool reverse_visible_order = (i->is_rtl != base::i18n::IsRTL());
444 int flags = gfx::Canvas::NO_ELLIPSIS; // We've already elided. 443 int flags = gfx::Canvas::NO_ELLIPSIS; // We've already elided.
445 if (reverse_visible_order) { 444 if (i->is_rtl != base::i18n::IsRTL())
446 std::reverse(i->classifications.begin(), i->classifications.end()); 445 std::reverse(i->classifications.begin(), i->classifications.end());
447 if (i->is_rtl)
448 flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY;
449 }
450 for (Classifications::const_iterator j(i->classifications.begin()); 446 for (Classifications::const_iterator j(i->classifications.begin());
451 j != i->classifications.end(); ++j) { 447 j != i->classifications.end(); ++j) {
452 const int left = 448 const int left =
453 mirroring_context_->mirrored_left_coord(x, x + j->pixel_size.width()); 449 mirroring_context_->mirrored_left_coord(x, x + j->pixel_size.width());
454 // By passing the same y-coordinate for each run, we vertically align the 450 // By passing the same y-coordinate for each run, we vertically align the
455 // tops of successive runs. This isn't actually what we want; we want to 451 // tops of successive runs. This isn't actually what we want; we want to
456 // align the baselines, but Canvas doesn't currently expose text 452 // align the baselines, but Canvas doesn't currently expose text
457 // measurement APIs sufficient to make that happen. The problem here is 453 // measurement APIs sufficient to make that happen. The problem here is
458 // font substitution: if no fonts are substituted, then all runs have the 454 // font substitution: if no fonts are substituted, then all runs have the
459 // same font (in bold or normal styles), and thus the same height and same 455 // same font (in bold or normal styles), and thus the same height and same
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 int x = GetMirroredXForRect(keyword_text_bounds_); 622 int x = GetMirroredXForRect(keyword_text_bounds_);
627 mirroring_context_->Initialize(x, keyword_text_bounds_.width()); 623 mirroring_context_->Initialize(x, keyword_text_bounds_.width());
628 PaintMatch(canvas, *match_.associated_keyword.get(), x); 624 PaintMatch(canvas, *match_.associated_keyword.get(), x);
629 } 625 }
630 } 626 }
631 627
632 void OmniboxResultView::AnimationProgressed(const ui::Animation* animation) { 628 void OmniboxResultView::AnimationProgressed(const ui::Animation* animation) {
633 Layout(); 629 Layout();
634 SchedulePaint(); 630 SchedulePaint();
635 } 631 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/canvas.h » ('j') | ui/views/controls/label.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698