| OLD | NEW |
| 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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1634 | 1634 |
| 1635 range.set_start(range.start() - before); | 1635 range.set_start(range.start() - before); |
| 1636 range.set_end(range.end() + after); | 1636 range.set_end(range.end() + after); |
| 1637 gfx::Range text_range; | 1637 gfx::Range text_range; |
| 1638 if (GetTextRange(&text_range) && text_range.Contains(range)) | 1638 if (GetTextRange(&text_range) && text_range.Contains(range)) |
| 1639 DeleteRange(range); | 1639 DeleteRange(range); |
| 1640 } | 1640 } |
| 1641 | 1641 |
| 1642 void Textfield::EnsureCaretInRect(const gfx::Rect& rect) {} | 1642 void Textfield::EnsureCaretInRect(const gfx::Rect& rect) {} |
| 1643 | 1643 |
| 1644 bool Textfield::IsEditCommandEnabled(int command_id) { | 1644 bool Textfield::IsEditCommandEnabled(int command_id) const { |
| 1645 return IsCommandIdEnabled(command_id); | 1645 return IsCommandIdEnabled(command_id); |
| 1646 } | 1646 } |
| 1647 | 1647 |
| 1648 void Textfield::SetEditCommandForNextKeyEvent(int command_id) { | 1648 void Textfield::SetEditCommandForNextKeyEvent(int command_id) { |
| 1649 DCHECK_EQ(kNoCommand, scheduled_edit_command_); | 1649 DCHECK_EQ(kNoCommand, scheduled_edit_command_); |
| 1650 scheduled_edit_command_ = command_id; | 1650 scheduled_edit_command_ = command_id; |
| 1651 } | 1651 } |
| 1652 | 1652 |
| 1653 //////////////////////////////////////////////////////////////////////////////// | 1653 //////////////////////////////////////////////////////////////////////////////// |
| 1654 // Textfield, protected: | 1654 // Textfield, protected: |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 RequestFocus(); | 1929 RequestFocus(); |
| 1930 model_->MoveCursorTo(mouse); | 1930 model_->MoveCursorTo(mouse); |
| 1931 if (!selection_clipboard_text.empty()) { | 1931 if (!selection_clipboard_text.empty()) { |
| 1932 model_->InsertText(selection_clipboard_text); | 1932 model_->InsertText(selection_clipboard_text); |
| 1933 UpdateAfterChange(true, true); | 1933 UpdateAfterChange(true, true); |
| 1934 } | 1934 } |
| 1935 OnAfterUserAction(); | 1935 OnAfterUserAction(); |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 } // namespace views | 1938 } // namespace views |
| OLD | NEW |