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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
628 } | 628 } |
629 | 629 |
630 void Textfield::OnMouseReleased(const ui::MouseEvent& event) { | 630 void Textfield::OnMouseReleased(const ui::MouseEvent& event) { |
631 selection_controller_.OnMouseReleased(event); | 631 selection_controller_.OnMouseReleased(event); |
632 } | 632 } |
633 | 633 |
634 void Textfield::OnMouseCaptureLost() { | 634 void Textfield::OnMouseCaptureLost() { |
635 selection_controller_.OnMouseCaptureLost(); | 635 selection_controller_.OnMouseCaptureLost(); |
636 } | 636 } |
637 | 637 |
638 bool Textfield::OnMouseWheel(const ui::MouseWheelEvent& event) { | |
639 return (controller_ && controller_->HandleMouseEvent(this, event)); | |
vadimt
2017/07/11 23:32:56
No braces.
newcomer
2017/07/12 16:56:00
Done.
| |
640 } | |
641 | |
638 WordLookupClient* Textfield::GetWordLookupClient() { | 642 WordLookupClient* Textfield::GetWordLookupClient() { |
639 return this; | 643 return this; |
640 } | 644 } |
641 | 645 |
642 bool Textfield::OnKeyPressed(const ui::KeyEvent& event) { | 646 bool Textfield::OnKeyPressed(const ui::KeyEvent& event) { |
643 ui::TextEditCommand edit_command = scheduled_text_edit_command_; | 647 ui::TextEditCommand edit_command = scheduled_text_edit_command_; |
644 scheduled_text_edit_command_ = ui::TextEditCommand::INVALID_COMMAND; | 648 scheduled_text_edit_command_ = ui::TextEditCommand::INVALID_COMMAND; |
645 | 649 |
646 // Since HandleKeyEvent() might destroy |this|, get a weak pointer and verify | 650 // Since HandleKeyEvent() might destroy |this|, get a weak pointer and verify |
647 // it isn't null before proceeding. | 651 // it isn't null before proceeding. |
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2114 cursor_blink_timer_.Stop(); | 2118 cursor_blink_timer_.Stop(); |
2115 } | 2119 } |
2116 | 2120 |
2117 void Textfield::OnCursorBlinkTimerFired() { | 2121 void Textfield::OnCursorBlinkTimerFired() { |
2118 DCHECK(ShouldBlinkCursor()); | 2122 DCHECK(ShouldBlinkCursor()); |
2119 UpdateCursorViewPosition(); | 2123 UpdateCursorViewPosition(); |
2120 cursor_view_.SetVisible(!cursor_view_.visible()); | 2124 cursor_view_.SetVisible(!cursor_view_.visible()); |
2121 } | 2125 } |
2122 | 2126 |
2123 } // namespace views | 2127 } // namespace views |
OLD | NEW |