| 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_TEXTFIELD_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 void AboutToRequestFocusFromTabTraversal(bool reverse) override; | 231 void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
| 232 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; | 232 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; |
| 233 bool GetDropFormats( | 233 bool GetDropFormats( |
| 234 int* formats, | 234 int* formats, |
| 235 std::set<ui::Clipboard::FormatType>* format_types) override; | 235 std::set<ui::Clipboard::FormatType>* format_types) override; |
| 236 bool CanDrop(const ui::OSExchangeData& data) override; | 236 bool CanDrop(const ui::OSExchangeData& data) override; |
| 237 int OnDragUpdated(const ui::DropTargetEvent& event) override; | 237 int OnDragUpdated(const ui::DropTargetEvent& event) override; |
| 238 void OnDragExited() override; | 238 void OnDragExited() override; |
| 239 int OnPerformDrop(const ui::DropTargetEvent& event) override; | 239 int OnPerformDrop(const ui::DropTargetEvent& event) override; |
| 240 void OnDragDone() override; | 240 void OnDragDone() override; |
| 241 void GetAccessibleState(ui::AXViewState* state) override; | 241 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 242 bool HandleAccessibleAction(const ui::AXActionData& action_data) override; |
| 242 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; | 243 void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
| 243 bool GetNeedsNotificationWhenVisibleBoundsChange() const override; | 244 bool GetNeedsNotificationWhenVisibleBoundsChange() const override; |
| 244 void OnVisibleBoundsChanged() override; | 245 void OnVisibleBoundsChanged() override; |
| 245 void OnEnabledChanged() override; | 246 void OnEnabledChanged() override; |
| 246 void OnPaint(gfx::Canvas* canvas) override; | 247 void OnPaint(gfx::Canvas* canvas) override; |
| 247 void OnFocus() override; | 248 void OnFocus() override; |
| 248 void OnBlur() override; | 249 void OnBlur() override; |
| 249 gfx::Point GetKeyboardContextMenuLocation() override; | 250 gfx::Point GetKeyboardContextMenuLocation() override; |
| 250 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 251 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 251 | 252 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 int GetViewHeight() const override; | 357 int GetViewHeight() const override; |
| 357 int GetViewWidth() const override; | 358 int GetViewWidth() const override; |
| 358 int GetDragSelectionDelay() const override; | 359 int GetDragSelectionDelay() const override; |
| 359 void OnBeforePointerAction() override; | 360 void OnBeforePointerAction() override; |
| 360 void OnAfterPointerAction(bool text_changed, bool selection_changed) override; | 361 void OnAfterPointerAction(bool text_changed, bool selection_changed) override; |
| 361 // Callers within Textfield should call UpdateAfterChange depending on the | 362 // Callers within Textfield should call UpdateAfterChange depending on the |
| 362 // return value. | 363 // return value. |
| 363 bool PasteSelectionClipboard() override; | 364 bool PasteSelectionClipboard() override; |
| 364 void UpdateSelectionClipboard() override; | 365 void UpdateSelectionClipboard() override; |
| 365 | 366 |
| 366 // Handles a request to change the value of this text field from software | |
| 367 // using an accessibility API (typically automation software, screen readers | |
| 368 // don't normally use this). If |clear_first| is true, this replaces all text | |
| 369 // with the |new_value|. Otherwise this inserts |new_value| at the cursor | |
| 370 // position, replacing any selected text. The cursor is placed at the end of | |
| 371 // |new_value|. | |
| 372 void AccessibilitySetValue(const base::string16& new_value, bool clear_first); | |
| 373 | |
| 374 // Updates the painted background color. | 367 // Updates the painted background color. |
| 375 void UpdateBackgroundColor(); | 368 void UpdateBackgroundColor(); |
| 376 | 369 |
| 377 // Updates the border per the state of |invalid_|. | 370 // Updates the border per the state of |invalid_|. |
| 378 void UpdateBorder(); | 371 void UpdateBorder(); |
| 379 | 372 |
| 380 // Does necessary updates when the text and/or cursor position changes. | 373 // Does necessary updates when the text and/or cursor position changes. |
| 381 void UpdateAfterChange(bool text_changed, bool cursor_changed); | 374 void UpdateAfterChange(bool text_changed, bool cursor_changed); |
| 382 | 375 |
| 383 // A callback function to periodically update the cursor state. | 376 // A callback function to periodically update the cursor node_data. |
| 384 void UpdateCursor(); | 377 void UpdateCursor(); |
| 385 | 378 |
| 386 // Repaint the cursor. | 379 // Repaint the cursor. |
| 387 void RepaintCursor(); | 380 void RepaintCursor(); |
| 388 | 381 |
| 389 void PaintTextAndCursor(gfx::Canvas* canvas); | 382 void PaintTextAndCursor(gfx::Canvas* canvas); |
| 390 | 383 |
| 391 // Helper function to call MoveCursorTo on the TextfieldModel. | 384 // Helper function to call MoveCursorTo on the TextfieldModel. |
| 392 void MoveCursorTo(const gfx::Point& point, bool select); | 385 void MoveCursorTo(const gfx::Point& point, bool select); |
| 393 | 386 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 529 |
| 537 // Used to bind callback functions to this object. | 530 // Used to bind callback functions to this object. |
| 538 base::WeakPtrFactory<Textfield> weak_ptr_factory_; | 531 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 539 | 532 |
| 540 DISALLOW_COPY_AND_ASSIGN(Textfield); | 533 DISALLOW_COPY_AND_ASSIGN(Textfield); |
| 541 }; | 534 }; |
| 542 | 535 |
| 543 } // namespace views | 536 } // namespace views |
| 544 | 537 |
| 545 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 538 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
| OLD | NEW |