| 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 else | 465 else |
| 466 model_->Replace(print_char); | 466 model_->Replace(print_char); |
| 467 text_changed = true; | 467 text_changed = true; |
| 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 (cursor_changed) { |
| 476 is_cursor_visible_ = true; |
| 477 RepaintCursor(); |
| 478 } |
| 475 if (text_changed || cursor_changed) { | 479 if (text_changed || cursor_changed) { |
| 476 UpdateCursorBoundsAndTextOffset(); | 480 UpdateCursorBoundsAndTextOffset(); |
| 477 SchedulePaint(); | 481 SchedulePaint(); |
| 478 return true; | 482 return true; |
| 479 } | 483 } |
| 480 } | 484 } |
| 481 return false; | 485 return false; |
| 482 } | 486 } |
| 483 | 487 |
| 484 char16 NativeTextfieldViews::GetPrintableChar(const KeyEvent& key_event) { | 488 char16 NativeTextfieldViews::GetPrintableChar(const KeyEvent& key_event) { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 } | 695 } |
| 692 | 696 |
| 693 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, | 697 void NativeTextfieldViews::TextfieldBorder::SetInsets(int top, |
| 694 int left, | 698 int left, |
| 695 int bottom, | 699 int bottom, |
| 696 int right) { | 700 int right) { |
| 697 insets_.Set(top, left, bottom, right); | 701 insets_.Set(top, left, bottom, right); |
| 698 } | 702 } |
| 699 | 703 |
| 700 } // namespace views | 704 } // namespace views |
| OLD | NEW |