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

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

Issue 5964013: OnKeyPress was not returning true when keypress is handled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | views/controls/textfield/native_textfield_views_unittest.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) 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 468 }
469 if (text_changed) { 469 if (text_changed) {
470 textfield_->SyncText(); 470 textfield_->SyncText();
471 Textfield::Controller* controller = textfield_->GetController(); 471 Textfield::Controller* controller = textfield_->GetController();
472 if (controller) 472 if (controller)
473 controller->ContentsChanged(textfield_, GetText()); 473 controller->ContentsChanged(textfield_, GetText());
474 } 474 }
475 if (text_changed || cursor_changed) { 475 if (text_changed || cursor_changed) {
476 UpdateCursorBoundsAndTextOffset(); 476 UpdateCursorBoundsAndTextOffset();
477 SchedulePaint(); 477 SchedulePaint();
478 return true;
478 } 479 }
479 } 480 }
480 return false; 481 return false;
481 } 482 }
482 483
483 char16 NativeTextfieldViews::GetPrintableChar(const KeyEvent& key_event) { 484 char16 NativeTextfieldViews::GetPrintableChar(const KeyEvent& key_event) {
484 // TODO(oshima): IME, i18n support. 485 // TODO(oshima): IME, i18n support.
485 // This only works for UCS-2 characters. 486 // This only works for UCS-2 characters.
486 app::KeyboardCode key_code = key_event.GetKeyCode(); 487 app::KeyboardCode key_code = key_event.GetKeyCode();
487 bool shift = key_event.IsShiftDown() ^ key_event.IsCapsLockDown(); 488 bool shift = key_event.IsShiftDown() ^ key_event.IsCapsLockDown();
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 } 690 }
690 691
691 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, 692 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top,
692 int left, 693 int left,
693 int bottom, 694 int bottom,
694 int right) { 695 int right) {
695 insets_.Set(top, left, bottom, right); 696 insets_.Set(top, left, bottom, right);
696 } 697 }
697 698
698 } // namespace views 699 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | views/controls/textfield/native_textfield_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698