| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/textfield_views_model.h" | 5 #include "views/controls/textfield/textfield_views_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/break_iterator.h" | 9 #include "base/i18n/break_iterator.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 #include "gfx/font.h" | |
| 13 #include "ui/base/clipboard/clipboard.h" | 12 #include "ui/base/clipboard/clipboard.h" |
| 14 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 13 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
| 14 #include "ui/gfx/font.h" |
| 15 #include "views/views_delegate.h" | 15 #include "views/views_delegate.h" |
| 16 #include "views/controls/textfield/textfield.h" | 16 #include "views/controls/textfield/textfield.h" |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 | 19 |
| 20 TextfieldViewsModel::TextfieldViewsModel() | 20 TextfieldViewsModel::TextfieldViewsModel() |
| 21 : cursor_pos_(0), | 21 : cursor_pos_(0), |
| 22 selection_begin_(0), | 22 selection_begin_(0), |
| 23 is_password_(false) { | 23 is_password_(false) { |
| 24 } | 24 } |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 | 334 |
| 335 size_t TextfieldViewsModel::GetSafePosition(size_t position) const { | 335 size_t TextfieldViewsModel::GetSafePosition(size_t position) const { |
| 336 if (position > text_.length()) { | 336 if (position > text_.length()) { |
| 337 return text_.length(); | 337 return text_.length(); |
| 338 } | 338 } |
| 339 return position; | 339 return position; |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace views | 342 } // namespace views |
| OLD | NEW |