| OLD | NEW |
| 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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 SelectionModel::TRAILING); | 470 SelectionModel::TRAILING); |
| 471 return selection_model_; | 471 return selection_model_; |
| 472 } | 472 } |
| 473 | 473 |
| 474 RenderText::RenderText() | 474 RenderText::RenderText() |
| 475 : text_(), | 475 : text_(), |
| 476 selection_model_(), | 476 selection_model_(), |
| 477 cursor_bounds_(), | 477 cursor_bounds_(), |
| 478 cursor_visible_(false), | 478 cursor_visible_(false), |
| 479 insert_mode_(true), | 479 insert_mode_(true), |
| 480 focused_(false), |
| 480 composition_range_(ui::Range::InvalidRange()), | 481 composition_range_(ui::Range::InvalidRange()), |
| 481 style_ranges_(), | 482 style_ranges_(), |
| 482 default_style_(), | 483 default_style_(), |
| 483 display_rect_(), | 484 display_rect_(), |
| 484 display_offset_(), | 485 display_offset_(), |
| 485 cached_bounds_and_offset_valid_(false) { | 486 cached_bounds_and_offset_valid_(false) { |
| 486 } | 487 } |
| 487 | 488 |
| 488 const Point& RenderText::GetUpdatedDisplayOffset() { | 489 const Point& RenderText::GetUpdatedDisplayOffset() { |
| 489 UpdateCachedBoundsAndOffset(); | 490 UpdateCachedBoundsAndOffset(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 | 686 |
| 686 void RenderText::DrawCursor(Canvas* canvas) { | 687 void RenderText::DrawCursor(Canvas* canvas) { |
| 687 TRACE_EVENT0("gfx", "RenderText::DrawCursor"); | 688 TRACE_EVENT0("gfx", "RenderText::DrawCursor"); |
| 688 // Paint cursor. Replace cursor is drawn as rectangle for now. | 689 // Paint cursor. Replace cursor is drawn as rectangle for now. |
| 689 // TODO(msw): Draw a better cursor with a better indication of association. | 690 // TODO(msw): Draw a better cursor with a better indication of association. |
| 690 if (cursor_visible() && focused()) | 691 if (cursor_visible() && focused()) |
| 691 canvas->DrawRect(GetUpdatedCursorBounds(), kCursorColor); | 692 canvas->DrawRect(GetUpdatedCursorBounds(), kCursorColor); |
| 692 } | 693 } |
| 693 | 694 |
| 694 } // namespace gfx | 695 } // namespace gfx |
| OLD | NEW |