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

Side by Side Diff: ui/views/examples/multiline_example.cc

Issue 120503005: Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix touch drag and drop unit test. Created 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/views/examples/multiline_example.h" 5 #include "ui/views/examples/multiline_example.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/gfx/render_text.h" 9 #include "ui/gfx/render_text.h"
10 #include "ui/views/background.h" 10 #include "ui/views/background.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 container()->SchedulePaint(); 149 container()->SchedulePaint();
150 } 150 }
151 151
152 bool MultilineExample::HandleKeyEvent(Textfield* sender, 152 bool MultilineExample::HandleKeyEvent(Textfield* sender,
153 const ui::KeyEvent& key_event) { 153 const ui::KeyEvent& key_event) {
154 return false; 154 return false;
155 } 155 }
156 156
157 void MultilineExample::ButtonPressed(Button* sender, const ui::Event& event) { 157 void MultilineExample::ButtonPressed(Button* sender, const ui::Event& event) {
158 DCHECK_EQ(sender, label_checkbox_); 158 DCHECK_EQ(sender, label_checkbox_);
159 label_->SetText(label_checkbox_->checked() ? textfield_->text() : 159 label_->SetText(label_checkbox_->checked() ? textfield_->GetText() :
160 base::string16()); 160 base::string16());
161 container()->Layout(); 161 container()->Layout();
162 container()->SchedulePaint(); 162 container()->SchedulePaint();
163 } 163 }
164 164
165 } // namespace examples 165 } // namespace examples
166 } // namespace views 166 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698