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 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "views/controls/textfield/native_textfield_wrapper.h" | 29 #include "views/controls/textfield/native_textfield_wrapper.h" |
30 #endif | 30 #endif |
31 | 31 |
32 namespace views { | 32 namespace views { |
33 | 33 |
34 class KeyEvent; | 34 class KeyEvent; |
35 class NativeTextfieldWrapper; | 35 class NativeTextfieldWrapper; |
36 | 36 |
37 // TextRange specifies the range of text in the Textfield. This is | 37 // TextRange specifies the range of text in the Textfield. This is |
38 // used to specify selected text and will be used to change the | 38 // used to specify selected text and will be used to change the |
39 // attributes of characters in the textfield. The range preserves the | 39 // attributes of characters in the textfield. When this is used for |
40 // direction, and selecting from the end to the begining is considered | 40 // selection, the end is caret position, and the start is where |
41 // "reverse" order. | 41 // selection started. The range preserves the direction, and |
| 42 // selecting from the end to the begining is considered "reverse" |
| 43 // order. (that is, start > end is reverse) |
42 class TextRange { | 44 class TextRange { |
43 public: | 45 public: |
44 TextRange() : start_(0), end_(0) {} | 46 TextRange() : start_(0), end_(0) {} |
45 TextRange(size_t start, size_t end); | 47 TextRange(size_t start, size_t end); |
46 | 48 |
47 // Allow copy so that the omnibox can save the view state | 49 // Allow copy so that the omnibox can save the view state |
48 // for each tabs. | 50 // for each tabs. |
49 explicit TextRange(const TextRange& range) | 51 explicit TextRange(const TextRange& range) |
50 : start_(range.start_), end_(range.end_) {} | 52 : start_(range.start_), end_(range.end_) {} |
51 | 53 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 340 |
339 // Text to display when empty. | 341 // Text to display when empty. |
340 string16 text_to_display_when_empty_; | 342 string16 text_to_display_when_empty_; |
341 | 343 |
342 DISALLOW_COPY_AND_ASSIGN(Textfield); | 344 DISALLOW_COPY_AND_ASSIGN(Textfield); |
343 }; | 345 }; |
344 | 346 |
345 } // namespace views | 347 } // namespace views |
346 | 348 |
347 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 349 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |