| 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 "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 bool GetSelectionRange(gfx::Range* range) const override; | 44 bool GetSelectionRange(gfx::Range* range) const override; |
| 45 bool SetSelectionRange(const gfx::Range& range) override; | 45 bool SetSelectionRange(const gfx::Range& range) override; |
| 46 bool DeleteRange(const gfx::Range& range) override; | 46 bool DeleteRange(const gfx::Range& range) override; |
| 47 bool GetTextFromRange(const gfx::Range& range, | 47 bool GetTextFromRange(const gfx::Range& range, |
| 48 base::string16* text) const override; | 48 base::string16* text) const override; |
| 49 void OnInputMethodChanged() override; | 49 void OnInputMethodChanged() override; |
| 50 bool ChangeTextDirectionAndLayoutAlignment( | 50 bool ChangeTextDirectionAndLayoutAlignment( |
| 51 base::i18n::TextDirection direction) override; | 51 base::i18n::TextDirection direction) override; |
| 52 void ExtendSelectionAndDelete(size_t before, size_t after) override; | 52 void ExtendSelectionAndDelete(size_t before, size_t after) override; |
| 53 void EnsureCaretInRect(const gfx::Rect& rect) override; | 53 void EnsureCaretInRect(const gfx::Rect& rect) override; |
| 54 void OnCandidateWindowShown() override; | |
| 55 void OnCandidateWindowUpdated() override; | |
| 56 void OnCandidateWindowHidden() override; | |
| 57 | 54 |
| 58 bool IsEditCommandEnabled(int command_id) override; | 55 bool IsEditCommandEnabled(int command_id) override; |
| 59 void SetEditCommandForNextKeyEvent(int command_id) override; | 56 void SetEditCommandForNextKeyEvent(int command_id) override; |
| 60 | 57 |
| 61 private: | 58 private: |
| 62 // Invoked when text is typed. Tries to change the selection appropriately. | 59 // Invoked when text is typed. Tries to change the selection appropriately. |
| 63 void OnTextInput(const base::string16& text); | 60 void OnTextInput(const base::string16& text); |
| 64 | 61 |
| 65 // Returns true if the text of the node at |row| starts with |lower_text|. | 62 // Returns true if the text of the node at |row| starts with |lower_text|. |
| 66 bool TextAtRowMatchesText(int row, const base::string16& lower_text); | 63 bool TextAtRowMatchesText(int row, const base::string16& lower_text); |
| 67 | 64 |
| 68 // Clears |current_text_| and resets |time_of_last_key_|. | 65 // Clears |current_text_| and resets |time_of_last_key_|. |
| 69 void ClearText(); | 66 void ClearText(); |
| 70 | 67 |
| 71 PrefixDelegate* prefix_delegate_; | 68 PrefixDelegate* prefix_delegate_; |
| 72 | 69 |
| 73 // Time OnTextInput() was last invoked. | 70 // Time OnTextInput() was last invoked. |
| 74 base::TimeTicks time_of_last_key_; | 71 base::TimeTicks time_of_last_key_; |
| 75 | 72 |
| 76 base::string16 current_text_; | 73 base::string16 current_text_; |
| 77 | 74 |
| 78 DISALLOW_COPY_AND_ASSIGN(PrefixSelector); | 75 DISALLOW_COPY_AND_ASSIGN(PrefixSelector); |
| 79 }; | 76 }; |
| 80 | 77 |
| 81 } // namespace views | 78 } // namespace views |
| 82 | 79 |
| 83 #endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ | 80 #endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ |
| OLD | NEW |