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

Side by Side Diff: views/examples/textfield_example.h

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
« no previous file with comments | « views/event_win.cc ('k') | views/widget/widget_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_ 5 #ifndef VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_
6 #define VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_ 6 #define VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "views/controls/button/text_button.h" 10 #include "views/controls/button/text_button.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 virtual void ContentsChanged(Textfield* sender, 68 virtual void ContentsChanged(Textfield* sender,
69 const string16& new_contents) { 69 const string16& new_contents) {
70 if (sender == name_) { 70 if (sender == name_) {
71 PrintStatus(L"Name [%ls]", UTF16ToWideHack(new_contents).c_str()); 71 PrintStatus(L"Name [%ls]", UTF16ToWideHack(new_contents).c_str());
72 } else if (sender == password_) { 72 } else if (sender == password_) {
73 PrintStatus(L"Password [%ls]", UTF16ToWideHack(new_contents).c_str()); 73 PrintStatus(L"Password [%ls]", UTF16ToWideHack(new_contents).c_str());
74 } 74 }
75 } 75 }
76 76
77 // Let the control handle keystrokes. 77 // Let the control handle keystrokes.
78 virtual bool HandleKeystroke(Textfield* sender, 78 virtual bool HandleKeyEvent(Textfield* sender,
79 const Textfield::Keystroke& keystroke) { 79 const views::KeyEvent& key_event) {
80 return false; 80 return false;
81 } 81 }
82 82
83 // ButtonListner implementation. 83 // ButtonListner implementation.
84 virtual void ButtonPressed(views::Button* sender, const views::Event& event) { 84 virtual void ButtonPressed(views::Button* sender, const views::Event& event) {
85 if (sender == show_password_) { 85 if (sender == show_password_) {
86 PrintStatus(L"Password [%ls]", 86 PrintStatus(L"Password [%ls]",
87 UTF16ToWideHack(password_->text()).c_str()); 87 UTF16ToWideHack(password_->text()).c_str());
88 } else if (sender == clear_all_) { 88 } else if (sender == clear_all_) {
89 string16 empty; 89 string16 empty;
(...skipping 12 matching lines...) Expand all
102 views::TextButton* show_password_; 102 views::TextButton* show_password_;
103 views::TextButton* clear_all_; 103 views::TextButton* clear_all_;
104 views::TextButton* append_; 104 views::TextButton* append_;
105 105
106 DISALLOW_COPY_AND_ASSIGN(TextfieldExample); 106 DISALLOW_COPY_AND_ASSIGN(TextfieldExample);
107 }; 107 };
108 108
109 } // namespace examples 109 } // namespace examples
110 110
111 #endif // VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_ 111 #endif // VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_
112
OLDNEW
« no previous file with comments | « views/event_win.cc ('k') | views/widget/widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698