Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/views/controls/prefix_selector.h

Issue 302293003: MacViews: Extend TextInputClient protocol with support for editing commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 base::string16* text) const OVERRIDE; 48 base::string16* text) const OVERRIDE;
49 virtual void OnInputMethodChanged() OVERRIDE; 49 virtual void OnInputMethodChanged() OVERRIDE;
50 virtual bool ChangeTextDirectionAndLayoutAlignment( 50 virtual bool ChangeTextDirectionAndLayoutAlignment(
51 base::i18n::TextDirection direction) OVERRIDE; 51 base::i18n::TextDirection direction) OVERRIDE;
52 virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE; 52 virtual void ExtendSelectionAndDelete(size_t before, size_t after) OVERRIDE;
53 virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE; 53 virtual void EnsureCaretInRect(const gfx::Rect& rect) OVERRIDE;
54 virtual void OnCandidateWindowShown() OVERRIDE; 54 virtual void OnCandidateWindowShown() OVERRIDE;
55 virtual void OnCandidateWindowUpdated() OVERRIDE; 55 virtual void OnCandidateWindowUpdated() OVERRIDE;
56 virtual void OnCandidateWindowHidden() OVERRIDE; 56 virtual void OnCandidateWindowHidden() OVERRIDE;
57 57
58 virtual bool IsEditingCommandEnabled(int command_id) OVERRIDE;
59 virtual void ExecuteEditingCommand(int command_id) OVERRIDE;
60
58 private: 61 private:
59 // Invoked when text is typed. Tries to change the selection appropriately. 62 // Invoked when text is typed. Tries to change the selection appropriately.
60 void OnTextInput(const base::string16& text); 63 void OnTextInput(const base::string16& text);
61 64
62 // Returns true if the text of the node at |row| starts with |lower_text|. 65 // Returns true if the text of the node at |row| starts with |lower_text|.
63 bool TextAtRowMatchesText(int row, const base::string16& lower_text); 66 bool TextAtRowMatchesText(int row, const base::string16& lower_text);
64 67
65 // Clears |current_text_| and resets |time_of_last_key_|. 68 // Clears |current_text_| and resets |time_of_last_key_|.
66 void ClearText(); 69 void ClearText();
67 70
68 PrefixDelegate* prefix_delegate_; 71 PrefixDelegate* prefix_delegate_;
69 72
70 // Time OnTextInput() was last invoked. 73 // Time OnTextInput() was last invoked.
71 base::TimeTicks time_of_last_key_; 74 base::TimeTicks time_of_last_key_;
72 75
73 base::string16 current_text_; 76 base::string16 current_text_;
74 77
75 DISALLOW_COPY_AND_ASSIGN(PrefixSelector); 78 DISALLOW_COPY_AND_ASSIGN(PrefixSelector);
76 }; 79 };
77 80
78 } // namespace views 81 } // namespace views
79 82
80 #endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_ 83 #endif // UI_VIEWS_CONTROLS_PREFIX_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698