| 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 |
| 11 #include "app/keyboard_codes.h" |
| 11 #include "base/string16.h" | 12 #include "base/string16.h" |
| 12 #include "gfx/rect.h" | 13 #include "gfx/rect.h" |
| 13 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
| 14 | 15 |
| 15 namespace gfx { | 16 namespace gfx { |
| 16 class Font; | 17 class Font; |
| 17 } // namespace gfx | 18 } // namespace gfx |
| 18 | 19 |
| 19 namespace views { | 20 namespace views { |
| 20 | 21 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 120 |
| 120 // Clears selection. | 121 // Clears selection. |
| 121 void ClearSelection(); | 122 void ClearSelection(); |
| 122 | 123 |
| 123 // Returns visible text. If the field is password, it returns the | 124 // Returns visible text. If the field is password, it returns the |
| 124 // sequence of "*". | 125 // sequence of "*". |
| 125 string16 GetVisibleText() const { | 126 string16 GetVisibleText() const { |
| 126 return GetVisibleText(0U, text_.length()); | 127 return GetVisibleText(0U, text_.length()); |
| 127 } | 128 } |
| 128 | 129 |
| 130 // Handles key event for Cut/Copy/Paste key presses. Returns true if text |
| 131 // has changed after handling the event (in case of cut and paste events). |
| 132 bool HandleClipboardEvents(app::KeyboardCode key_code); |
| 133 |
| 129 private: | 134 private: |
| 130 friend class NativeTextfieldViews; | 135 friend class NativeTextfieldViews; |
| 131 | 136 |
| 132 // Tells if any text is selected. | 137 // Tells if any text is selected. |
| 133 bool HasSelection() const; | 138 bool HasSelection() const; |
| 134 | 139 |
| 135 // Deletes the selected text. | 140 // Deletes the selected text. |
| 136 void DeleteSelection(); | 141 void DeleteSelection(); |
| 137 | 142 |
| 138 // Returns the visible text given |start| and |end|. | 143 // Returns the visible text given |start| and |end|. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 149 | 154 |
| 150 // True if the text is the password. | 155 // True if the text is the password. |
| 151 bool is_password_; | 156 bool is_password_; |
| 152 | 157 |
| 153 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 158 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
| 154 }; | 159 }; |
| 155 | 160 |
| 156 } // namespace views | 161 } // namespace views |
| 157 | 162 |
| 158 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 163 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
| OLD | NEW |