Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: views/controls/textfield/native_textfield_views.cc

Issue 6034002: Replace Textfield::Keystroke with views::KeyEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: key_code, ET_KEY_PRESS for WM_CHAR Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_gtk.cc ('k') | views/controls/textfield/native_textfield_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698