| 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 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // Clears selection. | 120 // Clears selection. |
| 121 void ClearSelection(); | 121 void ClearSelection(); |
| 122 | 122 |
| 123 // Returns visible text. If the field is password, it returns the | 123 // Returns visible text. If the field is password, it returns the |
| 124 // sequence of "*". | 124 // sequence of "*". |
| 125 string16 GetVisibleText() const { | 125 string16 GetVisibleText() const { |
| 126 return GetVisibleText(0U, text_.length()); | 126 return GetVisibleText(0U, text_.length()); |
| 127 } | 127 } |
| 128 | 128 |
| 129 // Cuts the currently selected text and puts it to clipboard. Returns true |
| 130 // if text has changed after cutting. |
| 131 bool Cut(); |
| 132 |
| 133 // Copies the currently selected text and puts it to clipboard. |
| 134 void Copy(); |
| 135 |
| 136 // Pastes text from the clipboard at current cursor position. Returns true |
| 137 // if text has changed after pasting. |
| 138 bool Paste(); |
| 139 |
| 129 private: | 140 private: |
| 130 friend class NativeTextfieldViews; | 141 friend class NativeTextfieldViews; |
| 131 | 142 |
| 132 // Tells if any text is selected. | 143 // Tells if any text is selected. |
| 133 bool HasSelection() const; | 144 bool HasSelection() const; |
| 134 | 145 |
| 135 // Deletes the selected text. | 146 // Deletes the selected text. |
| 136 void DeleteSelection(); | 147 void DeleteSelection(); |
| 137 | 148 |
| 138 // Returns the visible text given |start| and |end|. | 149 // Returns the visible text given |start| and |end|. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 149 | 160 |
| 150 // True if the text is the password. | 161 // True if the text is the password. |
| 151 bool is_password_; | 162 bool is_password_; |
| 152 | 163 |
| 153 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 164 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
| 154 }; | 165 }; |
| 155 | 166 |
| 156 } // namespace views | 167 } // namespace views |
| 157 | 168 |
| 158 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 169 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| OLD | NEW |