| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_PREFIX_SELECTOR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ |
| 6 #define UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ | 6 #define UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 bool SetSelectionRange(const gfx::Range& range) override; | 49 bool SetSelectionRange(const gfx::Range& range) override; |
| 50 bool DeleteRange(const gfx::Range& range) override; | 50 bool DeleteRange(const gfx::Range& range) override; |
| 51 bool GetTextFromRange(const gfx::Range& range, | 51 bool GetTextFromRange(const gfx::Range& range, |
| 52 base::string16* text) const override; | 52 base::string16* text) const override; |
| 53 void OnInputMethodChanged() override; | 53 void OnInputMethodChanged() override; |
| 54 bool ChangeTextDirectionAndLayoutAlignment( | 54 bool ChangeTextDirectionAndLayoutAlignment( |
| 55 base::i18n::TextDirection direction) override; | 55 base::i18n::TextDirection direction) override; |
| 56 void ExtendSelectionAndDelete(size_t before, size_t after) override; | 56 void ExtendSelectionAndDelete(size_t before, size_t after) override; |
| 57 void EnsureCaretInRect(const gfx::Rect& rect) override; | 57 void EnsureCaretInRect(const gfx::Rect& rect) override; |
| 58 | 58 |
| 59 bool IsEditCommandEnabled(int command_id) const override; | 59 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; |
| 60 void SetEditCommandForNextKeyEvent(int command_id) override; | 60 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 // Invoked when text is typed. Tries to change the selection appropriately. | 63 // Invoked when text is typed. Tries to change the selection appropriately. |
| 64 void OnTextInput(const base::string16& text); | 64 void OnTextInput(const base::string16& text); |
| 65 | 65 |
| 66 // Returns true if the text of the node at |row| starts with |lower_text|. | 66 // Returns true if the text of the node at |row| starts with |lower_text|. |
| 67 bool TextAtRowMatchesText(int row, const base::string16& lower_text); | 67 bool TextAtRowMatchesText(int row, const base::string16& lower_text); |
| 68 | 68 |
| 69 // Clears |current_text_| and resets |time_of_last_key_|. | 69 // Clears |current_text_| and resets |time_of_last_key_|. |
| 70 void ClearText(); | 70 void ClearText(); |
| 71 | 71 |
| 72 PrefixDelegate* prefix_delegate_; | 72 PrefixDelegate* prefix_delegate_; |
| 73 | 73 |
| 74 // Time OnTextInput() was last invoked. | 74 // Time OnTextInput() was last invoked. |
| 75 base::TimeTicks time_of_last_key_; | 75 base::TimeTicks time_of_last_key_; |
| 76 | 76 |
| 77 base::string16 current_text_; | 77 base::string16 current_text_; |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(PrefixSelector); | 79 DISALLOW_COPY_AND_ASSIGN(PrefixSelector); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 } // namespace views | 82 } // namespace views |
| 83 | 83 |
| 84 #endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ | 84 #endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ |
| OLD | NEW |