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

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

Issue 6628037: views: Moves TextfieldController/TextRange into their own headers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 9 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 (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 "ui/base/clipboard/clipboard.h" 12 #include "ui/base/clipboard/clipboard.h"
13 #include "ui/base/clipboard/scoped_clipboard_writer.h" 13 #include "ui/base/clipboard/scoped_clipboard_writer.h"
14 #include "ui/gfx/font.h" 14 #include "ui/gfx/font.h"
15 #include "views/controls/textfield/text_range.h"
16 #include "views/controls/textfield/textfield.h"
15 #include "views/views_delegate.h" 17 #include "views/views_delegate.h"
16 #include "views/controls/textfield/textfield.h"
17 18
18 namespace views { 19 namespace views {
19 20
20 TextfieldViewsModel::TextfieldViewsModel() 21 TextfieldViewsModel::TextfieldViewsModel()
21 : cursor_pos_(0), 22 : cursor_pos_(0),
22 selection_begin_(0), 23 selection_begin_(0),
23 is_password_(false) { 24 is_password_(false) {
24 } 25 }
25 26
26 TextfieldViewsModel::~TextfieldViewsModel() { 27 TextfieldViewsModel::~TextfieldViewsModel() {
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 334 }
334 335
335 size_t TextfieldViewsModel::GetSafePosition(size_t position) const { 336 size_t TextfieldViewsModel::GetSafePosition(size_t position) const {
336 if (position > text_.length()) { 337 if (position > text_.length()) {
337 return text_.length(); 338 return text_.length();
338 } 339 }
339 return position; 340 return position;
340 } 341 }
341 342
342 } // namespace views 343 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/textfield_controller.h ('k') | views/controls/textfield/textfield_views_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698