Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 bool MoveCursorTo(const gfx::Point& point, bool select); | 190 bool MoveCursorTo(const gfx::Point& point, bool select); |
| 191 | 191 |
| 192 // Utility function to inform the parent textfield (and its controller if any) | 192 // Utility function to inform the parent textfield (and its controller if any) |
| 193 // that the text in the textfield has changed. | 193 // that the text in the textfield has changed. |
| 194 void PropagateTextChange(); | 194 void PropagateTextChange(); |
| 195 | 195 |
| 196 // Does necessary updates when the text and/or the position of the cursor | 196 // Does necessary updates when the text and/or the position of the cursor |
| 197 // changed. | 197 // changed. |
| 198 void UpdateAfterChange(bool text_changed, bool cursor_changed); | 198 void UpdateAfterChange(bool text_changed, bool cursor_changed); |
| 199 | 199 |
| 200 // Utility function to prepare the context menu.. | 200 // Utility function to prepare the context menu. |
| 201 void UpdateContextMenu(); | 201 void UpdateContextMenu(); |
| 202 | 202 |
| 203 // Convenience method to call InputMethod::OnTextInputTypeChanged(); | 203 // Convenience method to call InputMethod::OnTextInputTypeChanged(); |
| 204 void OnTextInputTypeChanged(); | 204 void OnTextInputTypeChanged(); |
| 205 | 205 |
| 206 // Convenience method to call InputMethod::OnCaretBoundsChanged(); | 206 // Convenience method to call InputMethod::OnCaretBoundsChanged(); |
| 207 void OnCaretBoundsChanged(); | 207 void OnCaretBoundsChanged(); |
| 208 | 208 |
| 209 // Convenience method to call TextfieldController::OnBeforeUserAction(); | 209 // Convenience method to call TextfieldController::OnBeforeUserAction(); |
| 210 void OnBeforeUserAction(); | 210 void OnBeforeUserAction(); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 228 // Handles mouse press events. | 228 // Handles mouse press events. |
| 229 void HandleMousePressEvent(const MouseEvent& event); | 229 void HandleMousePressEvent(const MouseEvent& event); |
| 230 | 230 |
| 231 // Returns true if the current text input type allows access by the IME. | 231 // Returns true if the current text input type allows access by the IME. |
| 232 bool ImeEditingAllowed() const; | 232 bool ImeEditingAllowed() const; |
| 233 | 233 |
| 234 // Returns true if distance between |event| and |last_click_location_| | 234 // Returns true if distance between |event| and |last_click_location_| |
| 235 // exceeds the drag threshold. | 235 // exceeds the drag threshold. |
| 236 bool ExceededDragThresholdFromLastClickLocation(const MouseEvent& event); | 236 bool ExceededDragThresholdFromLastClickLocation(const MouseEvent& event); |
| 237 | 237 |
| 238 // Converts |text| to lower case if |textfield_| has STYLE_LOWERCASE style. | |
| 239 void MaybeLowerCase(string16* text); | |
|
msw
2012/04/12 16:15:29
Please rename this GetTextForDisplay or similar fo
kochi
2012/04/13 09:44:09
Done.
| |
| 240 | |
| 238 // Checks if a char is ok to be inserted into the textfield. The |ch| is a | 241 // Checks if a char is ok to be inserted into the textfield. The |ch| is a |
| 239 // modified character, i.e., modifiers took effect when generating this char. | 242 // modified character, i.e., modifiers took effect when generating this char. |
| 240 static bool ShouldInsertChar(char16 ch, int flags); | 243 static bool ShouldInsertChar(char16 ch, int flags); |
| 241 | 244 |
| 242 // The parent textfield, the owner of this object. | 245 // The parent textfield, the owner of this object. |
| 243 Textfield* textfield_; | 246 Textfield* textfield_; |
| 244 | 247 |
| 245 // The text model. | 248 // The text model. |
| 246 scoped_ptr<TextfieldViewsModel> model_; | 249 scoped_ptr<TextfieldViewsModel> model_; |
| 247 | 250 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 273 scoped_ptr<views::MenuRunner> context_menu_runner_; | 276 scoped_ptr<views::MenuRunner> context_menu_runner_; |
| 274 | 277 |
| 275 scoped_ptr<TouchSelectionController> touch_selection_controller_; | 278 scoped_ptr<TouchSelectionController> touch_selection_controller_; |
| 276 | 279 |
| 277 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); | 280 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); |
| 278 }; | 281 }; |
| 279 | 282 |
| 280 } // namespace views | 283 } // namespace views |
| 281 | 284 |
| 282 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 285 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
| OLD | NEW |