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

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

Issue 8772041: Remove deprecated TabContentsDelegate::OpenURLFromTab variant (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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 | « tools/valgrind/valgrind_test.py ('k') | webkit/glue/context_menu.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 DCHECK_LE(model.selection_start(), text().length()); 504 DCHECK_LE(model.selection_start(), text().length());
505 selection_model_.set_selection_start(model.selection_start()); 505 selection_model_.set_selection_start(model.selection_start());
506 DCHECK_LE(model.selection_end(), text().length()); 506 DCHECK_LE(model.selection_end(), text().length());
507 selection_model_.set_selection_end(model.selection_end()); 507 selection_model_.set_selection_end(model.selection_end());
508 DCHECK_LT(model.caret_pos(), 508 DCHECK_LT(model.caret_pos(),
509 std::max(text().length(), static_cast<size_t>(1))); 509 std::max(text().length(), static_cast<size_t>(1)));
510 selection_model_.set_caret_pos(model.caret_pos()); 510 selection_model_.set_caret_pos(model.caret_pos());
511 selection_model_.set_caret_placement(model.caret_placement()); 511 selection_model_.set_caret_placement(model.caret_placement());
512 512
513 cached_bounds_and_offset_valid_ = false; 513 cached_bounds_and_offset_valid_ = false;
514 UpdateLayout();
514 } 515 }
515 516
516 size_t RenderText::GetIndexOfPreviousGrapheme(size_t position) { 517 size_t RenderText::GetIndexOfPreviousGrapheme(size_t position) {
517 return IndexOfAdjacentGrapheme(position, false); 518 return IndexOfAdjacentGrapheme(position, false);
518 } 519 }
519 520
520 void RenderText::ApplyCompositionAndSelectionStyles( 521 void RenderText::ApplyCompositionAndSelectionStyles(
521 StyleRanges* style_ranges) const { 522 StyleRanges* style_ranges) const {
522 // TODO(msw): This pattern ought to be reconsidered; what about composition 523 // TODO(msw): This pattern ought to be reconsidered; what about composition
523 // and selection overlaps, retain existing local style features? 524 // and selection overlaps, retain existing local style features?
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 void RenderText::DrawCursor(Canvas* canvas) { 612 void RenderText::DrawCursor(Canvas* canvas) {
612 // Paint cursor. Replace cursor is drawn as rectangle for now. 613 // Paint cursor. Replace cursor is drawn as rectangle for now.
613 // TODO(msw): Draw a better cursor with a better indication of association. 614 // TODO(msw): Draw a better cursor with a better indication of association.
614 if (cursor_visible() && focused()) { 615 if (cursor_visible() && focused()) {
615 Rect r(GetUpdatedCursorBounds()); 616 Rect r(GetUpdatedCursorBounds());
616 canvas->DrawRectInt(kCursorColor, r.x(), r.y(), r.width(), r.height()); 617 canvas->DrawRectInt(kCursorColor, r.x(), r.y(), r.width(), r.height());
617 } 618 }
618 } 619 }
619 620
620 } // namespace gfx 621 } // namespace gfx
OLDNEW
« no previous file with comments | « tools/valgrind/valgrind_test.py ('k') | webkit/glue/context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698