| 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 } | 693 } |
| 696 | 694 |
| 697 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 695 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 698 int left, | 696 int left, |
| 699 int bottom, | 697 int bottom, |
| 700 int right) { | 698 int right) { |
| 701 insets_.Set(top, left, bottom, right); | 699 insets_.Set(top, left, bottom, right); |
| 702 } | 700 } |
| 703 | 701 |
| 704 } // namespace views | 702 } // namespace views |
| OLD | NEW |