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

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

Issue 18848002: Shows Japanese and English mixed queries correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disables the test on Android. Created 7 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/gfx/font_list_unittest.cc ('k') | ui/gfx/render_text_linux.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.h" 5 #include "ui/gfx/render_text.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/logging.h" 10 #include "base/logging.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 font_list_ = font_list; 350 font_list_ = font_list;
351 cached_bounds_and_offset_valid_ = false; 351 cached_bounds_and_offset_valid_ = false;
352 ResetLayout(); 352 ResetLayout();
353 } 353 }
354 354
355 void RenderText::SetFont(const Font& font) { 355 void RenderText::SetFont(const Font& font) {
356 SetFontList(FontList(font)); 356 SetFontList(FontList(font));
357 } 357 }
358 358
359 void RenderText::SetFontSize(int size) { 359 void RenderText::SetFontSize(int size) {
360 font_list_ = font_list_.DeriveFontListWithSize(size); 360 SetFontList(font_list_.DeriveFontListWithSize(size));
361 cached_bounds_and_offset_valid_ = false;
362 ResetLayout();
363 } 361 }
364 362
365 void RenderText::SetCursorEnabled(bool cursor_enabled) { 363 void RenderText::SetCursorEnabled(bool cursor_enabled) {
366 cursor_enabled_ = cursor_enabled; 364 cursor_enabled_ = cursor_enabled;
367 cached_bounds_and_offset_valid_ = false; 365 cached_bounds_and_offset_valid_ = false;
368 } 366 }
369 367
370 const Font& RenderText::GetFont() const { 368 const Font& RenderText::GetFont() const {
371 return font_list_.GetFonts()[0]; 369 return font_list_.GetFonts()[0];
372 } 370 }
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 cursor_bounds_ += delta_offset; 1014 cursor_bounds_ += delta_offset;
1017 } 1015 }
1018 1016
1019 void RenderText::DrawSelection(Canvas* canvas) { 1017 void RenderText::DrawSelection(Canvas* canvas) {
1020 const std::vector<Rect> sel = GetSubstringBounds(selection()); 1018 const std::vector<Rect> sel = GetSubstringBounds(selection());
1021 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i) 1019 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
1022 canvas->FillRect(*i, selection_background_focused_color_); 1020 canvas->FillRect(*i, selection_background_focused_color_);
1023 } 1021 }
1024 1022
1025 } // namespace gfx 1023 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font_list_unittest.cc ('k') | ui/gfx/render_text_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698