| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/textfield/native_textfield_views.h" | 5 #include "views/controls/textfield/native_textfield_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 SchedulePaint(); | 89 SchedulePaint(); |
| 90 } | 90 } |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void NativeTextfieldViews::OnMouseReleased(const views::MouseEvent& e, | 94 void NativeTextfieldViews::OnMouseReleased(const views::MouseEvent& e, |
| 95 bool canceled) { | 95 bool canceled) { |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool NativeTextfieldViews::OnKeyPressed(const views::KeyEvent& e) { | 98 bool NativeTextfieldViews::OnKeyPressed(const views::KeyEvent& e) { |
| 99 DLOG(WARNING) << "on key pressed"; |
| 99 Textfield::Controller* controller = textfield_->GetController(); | 100 Textfield::Controller* controller = textfield_->GetController(); |
| 100 bool handled = false; | 101 bool handled = false; |
| 101 if (controller) { | 102 if (controller) { |
| 102 Textfield::Keystroke ks(&e); | 103 handled = controller->HandleKeyEvent(textfield_, e); |
| 103 handled = controller->HandleKeystroke(textfield_, ks); | |
| 104 } | 104 } |
| 105 return handled || HandleKeyEvent(e); | 105 return handled || HandleKeyEvent(e); |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool NativeTextfieldViews::OnKeyReleased(const views::KeyEvent& e) { | 108 bool NativeTextfieldViews::OnKeyReleased(const views::KeyEvent& e) { |
| 109 return true; | 109 return true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void NativeTextfieldViews::Paint(gfx::Canvas* canvas) { | 112 void NativeTextfieldViews::Paint(gfx::Canvas* canvas) { |
| 113 text_border_->set_has_focus(HasFocus()); | 113 text_border_->set_has_focus(HasFocus()); |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 } | 689 } |
| 690 | 690 |
| 691 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 691 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 692 int left, | 692 int left, |
| 693 int bottom, | 693 int bottom, |
| 694 int right) { | 694 int right) { |
| 695 insets_.Set(top, left, bottom, right); | 695 insets_.Set(top, left, bottom, right); |
| 696 } | 696 } |
| 697 | 697 |
| 698 } // namespace views | 698 } // namespace views |
| OLD | NEW |