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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_gtk.h

Issue 5966006: Hitting Tab should always move cursor to end of omnibox text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build. Created 9 years, 11 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 virtual void OnTemporaryTextMaybeChanged(const string16& display_text, 137 virtual void OnTemporaryTextMaybeChanged(const string16& display_text,
138 bool save_original_selection); 138 bool save_original_selection);
139 virtual bool OnInlineAutocompleteTextMaybeChanged( 139 virtual bool OnInlineAutocompleteTextMaybeChanged(
140 const string16& display_text, size_t user_text_length); 140 const string16& display_text, size_t user_text_length);
141 virtual void OnRevertTemporaryText(); 141 virtual void OnRevertTemporaryText();
142 virtual void OnBeforePossibleChange(); 142 virtual void OnBeforePossibleChange();
143 virtual bool OnAfterPossibleChange(); 143 virtual bool OnAfterPossibleChange();
144 virtual gfx::NativeView GetNativeView() const; 144 virtual gfx::NativeView GetNativeView() const;
145 virtual CommandUpdater* GetCommandUpdater(); 145 virtual CommandUpdater* GetCommandUpdater();
146 virtual void SetInstantSuggestion(const string16& suggestion); 146 virtual void SetInstantSuggestion(const string16& suggestion);
147 virtual string16 GetInstantSuggestion() const;
147 virtual int TextWidth() const; 148 virtual int TextWidth() const;
148 virtual bool IsImeComposing() const; 149 virtual bool IsImeComposing() const;
149 150
150 #if defined(TOOLKIT_VIEWS) 151 #if defined(TOOLKIT_VIEWS)
151 virtual views::View* AddToView(views::View* parent); 152 virtual views::View* AddToView(views::View* parent);
152 virtual bool CommitInstantSuggestion(const string16& typed_text,
153 const string16& suggested_text);
154 153
155 // Enables accessibility on AutocompleteEditView. 154 // Enables accessibility on AutocompleteEditView.
156 void EnableAccessibility(); 155 void EnableAccessibility();
157 156
158 // A factory method to create an AutocompleteEditView instance initialized for 157 // A factory method to create an AutocompleteEditView instance initialized for
159 // linux_views. This currently returns an instance of 158 // linux_views. This currently returns an instance of
160 // AutocompleteEditViewGtk only, but AutocompleteEditViewViews will 159 // AutocompleteEditViewGtk only, but AutocompleteEditViewViews will
161 // be added as an option when TextfieldViews is enabled. 160 // be added as an option when TextfieldViews is enabled.
162 static AutocompleteEditView* Create(AutocompleteEditController* controller, 161 static AutocompleteEditView* Create(AutocompleteEditController* controller,
163 ToolbarModel* toolbar_model, 162 ToolbarModel* toolbar_model,
(...skipping 12 matching lines...) Expand all
176 virtual void AnimationEnded(const ui::Animation* animation); 175 virtual void AnimationEnded(const ui::Animation* animation);
177 virtual void AnimationProgressed(const ui::Animation* animation); 176 virtual void AnimationProgressed(const ui::Animation* animation);
178 virtual void AnimationCanceled(const ui::Animation* animation); 177 virtual void AnimationCanceled(const ui::Animation* animation);
179 178
180 // Sets the colors of the text view according to the theme. 179 // Sets the colors of the text view according to the theme.
181 void SetBaseColor(); 180 void SetBaseColor();
182 // Sets the colors of the instant suggestion view according to the theme and 181 // Sets the colors of the instant suggestion view according to the theme and
183 // the animation state. 182 // the animation state.
184 void UpdateInstantViewColors(); 183 void UpdateInstantViewColors();
185 184
186 bool CommitInstantSuggestion();
187
188 GtkWidget* text_view() { 185 GtkWidget* text_view() {
189 return text_view_; 186 return text_view_;
190 } 187 }
191 188
192 private: 189 private:
193 CHROMEG_CALLBACK_0(AutocompleteEditViewGtk, void, HandleBeginUserAction, 190 CHROMEG_CALLBACK_0(AutocompleteEditViewGtk, void, HandleBeginUserAction,
194 GtkTextBuffer*); 191 GtkTextBuffer*);
195 CHROMEG_CALLBACK_0(AutocompleteEditViewGtk, void, HandleEndUserAction, 192 CHROMEG_CALLBACK_0(AutocompleteEditViewGtk, void, HandleEndUserAction,
196 GtkTextBuffer*); 193 GtkTextBuffer*);
197 CHROMEG_CALLBACK_2(AutocompleteEditViewGtk, void, HandleMarkSet, 194 CHROMEG_CALLBACK_2(AutocompleteEditViewGtk, void, HandleMarkSet,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // blocks the "mark-set" signal handler. 292 // blocks the "mark-set" signal handler.
296 void StartUpdatingHighlightedText(); 293 void StartUpdatingHighlightedText();
297 294
298 // Finish updating |text_buffer_|'s highlighting such that future changes will 295 // Finish updating |text_buffer_|'s highlighting such that future changes will
299 // automatically update the PRIMARY selection. Undoes 296 // automatically update the PRIMARY selection. Undoes
300 // StartUpdatingHighlightedText()'s changes. 297 // StartUpdatingHighlightedText()'s changes.
301 void FinishUpdatingHighlightedText(); 298 void FinishUpdatingHighlightedText();
302 299
303 // Get the character indices of the current selection. This honors 300 // Get the character indices of the current selection. This honors
304 // direction, cp_max is the insertion point, and cp_min is the bound. 301 // direction, cp_max is the insertion point, and cp_min is the bound.
305 CharRange GetSelection(); 302 CharRange GetSelection() const;
306 303
307 // Translate from character positions to iterators for the current buffer. 304 // Translate from character positions to iterators for the current buffer.
308 void ItersFromCharRange(const CharRange& range, 305 void ItersFromCharRange(const CharRange& range,
309 GtkTextIter* iter_min, 306 GtkTextIter* iter_min,
310 GtkTextIter* iter_max); 307 GtkTextIter* iter_max);
311 308
312 // Return the number of characers in the current buffer. 309 // Return the number of characers in the current buffer.
313 int GetTextLength() const; 310 int GetTextLength() const;
314 311
312 // Places the caret at the given position. This clears any selection.
313 void PlaceCaretAt(int pos);
314
315 // Returns true if the caret is at the end of the content.
316 bool IsCaretAtEnd() const;
317
315 // Try to parse the current text as a URL and colorize the components. 318 // Try to parse the current text as a URL and colorize the components.
316 void EmphasizeURLComponents(); 319 void EmphasizeURLComponents();
317 320
318 // Internally invoked whenever the text changes in some way. 321 // Internally invoked whenever the text changes in some way.
319 void TextChanged(); 322 void TextChanged();
320 323
321 // Save |selected_text| as the PRIMARY X selection. Unlike 324 // Save |selected_text| as the PRIMARY X selection. Unlike
322 // OwnPrimarySelection(), this won't set an owner or use callbacks. 325 // OwnPrimarySelection(), this won't set an owner or use callbacks.
323 void SavePrimarySelection(const std::string& selected_text); 326 void SavePrimarySelection(const std::string& selected_text);
324 327
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 ui::GtkSignalRegistrar signals_; 528 ui::GtkSignalRegistrar signals_;
526 529
527 #if defined(TOOLKIT_VIEWS) 530 #if defined(TOOLKIT_VIEWS)
528 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; 531 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_;
529 #endif 532 #endif
530 533
531 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); 534 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk);
532 }; 535 };
533 536
534 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ 537 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698