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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 2413223003: Views:: Make Labels support text selection. (Closed)
Patch Set: -- Created 4 years, 1 month 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
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/views/controls/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 // Textfield, SelectionControllerDelegate overrides: 1755 // Textfield, SelectionControllerDelegate overrides:
1756 1756
1757 gfx::RenderText* Textfield::GetRenderTextForSelectionController() { 1757 gfx::RenderText* Textfield::GetRenderTextForSelectionController() {
1758 return GetRenderText(); 1758 return GetRenderText();
1759 } 1759 }
1760 1760
1761 bool Textfield::IsReadOnly() const { 1761 bool Textfield::IsReadOnly() const {
1762 return read_only(); 1762 return read_only();
1763 } 1763 }
1764 1764
1765 bool Textfield::SupportsDrag() const {
1766 return true;
1767 }
1768
1765 void Textfield::SetTextBeingDragged(bool value) { 1769 void Textfield::SetTextBeingDragged(bool value) {
1766 initiating_drag_ = value; 1770 initiating_drag_ = value;
1767 } 1771 }
1768 1772
1769 int Textfield::GetViewHeight() const { 1773 int Textfield::GetViewHeight() const {
1770 return height(); 1774 return height();
1771 } 1775 }
1772 1776
1773 int Textfield::GetViewWidth() const { 1777 int Textfield::GetViewWidth() const {
1774 return width(); 1778 return width();
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2041 } 2045 }
2042 2046
2043 void Textfield::OnCursorBlinkTimerFired() { 2047 void Textfield::OnCursorBlinkTimerFired() {
2044 DCHECK(ShouldBlinkCursor()); 2048 DCHECK(ShouldBlinkCursor());
2045 gfx::RenderText* render_text = GetRenderText(); 2049 gfx::RenderText* render_text = GetRenderText();
2046 render_text->set_cursor_visible(!render_text->cursor_visible()); 2050 render_text->set_cursor_visible(!render_text->cursor_visible());
2047 RepaintCursor(); 2051 RepaintCursor();
2048 } 2052 }
2049 2053
2050 } // namespace views 2054 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698