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

Side by Side Diff: ui/gfx/render_text_win.cc

Issue 10797017: base: Make ScopedVector::clear() destroy elements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update location_bar_view_mac.mm 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 | « ui/base/models/tree_node_model.h ('k') | ui/views/controls/native_control_win.cc » ('j') | no next file with comments »
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 #include "ui/gfx/render_text_win.h" 5 #include "ui/gfx/render_text_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/break_iterator.h" 9 #include "base/i18n/break_iterator.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 style.strike = run->strike; 586 style.strike = run->strike;
587 style.diagonal_strike = run->diagonal_strike; 587 style.diagonal_strike = run->diagonal_strike;
588 style.underline = run->underline; 588 style.underline = run->underline;
589 renderer.DrawDecorations(x, y, run->width, style); 589 renderer.DrawDecorations(x, y, run->width, style);
590 590
591 x = glyph_x; 591 x = glyph_x;
592 } 592 }
593 } 593 }
594 594
595 void RenderTextWin::ItemizeLogicalText() { 595 void RenderTextWin::ItemizeLogicalText() {
596 runs_.reset(); 596 runs_.clear();
597 string_size_ = Size(0, GetFont().GetHeight()); 597 string_size_ = Size(0, GetFont().GetHeight());
598 common_baseline_ = 0; 598 common_baseline_ = 0;
599 599
600 // Use the first strong character direction as the base text direction. 600 // Use the first strong character direction as the base text direction.
601 // TODO(msw): Use the application text direction instead of LTR by default? 601 // TODO(msw): Use the application text direction instead of LTR by default?
602 script_state_.uBidiLevel = 602 script_state_.uBidiLevel =
603 (base::i18n::GetFirstStrongCharacterDirection(text()) == 603 (base::i18n::GetFirstStrongCharacterDirection(text()) ==
604 base::i18n::RIGHT_TO_LEFT) ? 1 : 0; 604 base::i18n::RIGHT_TO_LEFT) ? 1 : 0;
605 605
606 if (text().empty()) 606 if (text().empty())
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 const internal::TextRun* run) { 949 const internal::TextRun* run) {
950 size_t caret = IndexOfAdjacentGrapheme(run->range.end(), CURSOR_BACKWARD); 950 size_t caret = IndexOfAdjacentGrapheme(run->range.end(), CURSOR_BACKWARD);
951 return SelectionModel(caret, CURSOR_FORWARD); 951 return SelectionModel(caret, CURSOR_FORWARD);
952 } 952 }
953 953
954 RenderText* RenderText::CreateInstance() { 954 RenderText* RenderText::CreateInstance() {
955 return new RenderTextWin; 955 return new RenderTextWin;
956 } 956 }
957 957
958 } // namespace gfx 958 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/base/models/tree_node_model.h ('k') | ui/views/controls/native_control_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698