| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Textfield::Controller* controller = textfield_->GetController(); | 99 Textfield::Controller* controller = textfield_->GetController(); |
| 100 bool handled = false; | 100 bool handled = false; |
| 101 if (controller) { | 101 if (controller) |
| 102 Textfield::Keystroke ks(&e); | 102 handled = controller->HandleKeyEvent(textfield_, e); |
| 103 handled = controller->HandleKeystroke(textfield_, ks); | |
| 104 } | |
| 105 return handled || HandleKeyEvent(e); | 103 return handled || HandleKeyEvent(e); |
| 106 } | 104 } |
| 107 | 105 |
| 108 bool NativeTextfieldViews::OnKeyReleased(const views::KeyEvent& e) { | 106 bool NativeTextfieldViews::OnKeyReleased(const views::KeyEvent& e) { |
| 109 return true; | 107 return true; |
| 110 } | 108 } |
| 111 | 109 |
| 112 void NativeTextfieldViews::Paint(gfx::Canvas* canvas) { | 110 void NativeTextfieldViews::Paint(gfx::Canvas* canvas) { |
| 113 text_border_->set_has_focus(HasFocus()); | 111 text_border_->set_has_focus(HasFocus()); |
| 114 PaintBackground(canvas); | 112 PaintBackground(canvas); |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 } | 688 } |
| 691 | 689 |
| 692 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 690 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 693 int left, | 691 int left, |
| 694 int bottom, | 692 int bottom, |
| 695 int right) { | 693 int right) { |
| 696 insets_.Set(top, left, bottom, right); | 694 insets_.Set(top, left, bottom, right); |
| 697 } | 695 } |
| 698 | 696 |
| 699 } // namespace views | 697 } // namespace views |
| OLD | NEW |