OLD | NEW |
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 virtual bool OnAfterPossibleChange(); | 140 virtual bool OnAfterPossibleChange(); |
141 virtual gfx::NativeView GetNativeView() const; | 141 virtual gfx::NativeView GetNativeView() const; |
142 virtual CommandUpdater* GetCommandUpdater(); | 142 virtual CommandUpdater* GetCommandUpdater(); |
143 virtual void SetInstantSuggestion(const string16& suggestion); | 143 virtual void SetInstantSuggestion(const string16& suggestion); |
144 virtual string16 GetInstantSuggestion() const; | 144 virtual string16 GetInstantSuggestion() const; |
145 virtual int TextWidth() const; | 145 virtual int TextWidth() const; |
146 virtual bool IsImeComposing() const; | 146 virtual bool IsImeComposing() const; |
147 | 147 |
148 #if defined(TOOLKIT_VIEWS) | 148 #if defined(TOOLKIT_VIEWS) |
149 virtual views::View* AddToView(views::View* parent); | 149 virtual views::View* AddToView(views::View* parent); |
| 150 virtual int OnPerformDrop(const views::DropTargetEvent& event); |
150 | 151 |
151 // Enables accessibility on AutocompleteEditView. | 152 // Enables accessibility on AutocompleteEditView. |
152 void EnableAccessibility(); | 153 void EnableAccessibility(); |
153 | 154 |
154 // A factory method to create an AutocompleteEditView instance initialized for | 155 // A factory method to create an AutocompleteEditView instance initialized for |
155 // linux_views. This currently returns an instance of | 156 // linux_views. This currently returns an instance of |
156 // AutocompleteEditViewGtk only, but AutocompleteEditViewViews will | 157 // AutocompleteEditViewGtk only, but AutocompleteEditViewViews will |
157 // be added as an option when TextfieldViews is enabled. | 158 // be added as an option when TextfieldViews is enabled. |
158 static AutocompleteEditView* Create(AutocompleteEditController* controller, | 159 static AutocompleteEditView* Create(AutocompleteEditController* controller, |
159 ToolbarModel* toolbar_model, | 160 ToolbarModel* toolbar_model, |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 static void ClipboardGetSelectionThunk(GtkClipboard* clipboard, | 270 static void ClipboardGetSelectionThunk(GtkClipboard* clipboard, |
270 GtkSelectionData* selection_data, | 271 GtkSelectionData* selection_data, |
271 guint info, | 272 guint info, |
272 gpointer object); | 273 gpointer object); |
273 void ClipboardGetSelection(GtkClipboard* clipboard, | 274 void ClipboardGetSelection(GtkClipboard* clipboard, |
274 GtkSelectionData* selection_data, | 275 GtkSelectionData* selection_data, |
275 guint info); | 276 guint info); |
276 | 277 |
277 void HandleCopyOrCutClipboard(bool copy); | 278 void HandleCopyOrCutClipboard(bool copy); |
278 | 279 |
| 280 // Common implementation for performing a drop on the edit view. |
| 281 bool OnPerformDropImpl(const string16& text); |
| 282 |
279 // Returns the font used in |text_view_|. | 283 // Returns the font used in |text_view_|. |
280 gfx::Font GetFont(); | 284 gfx::Font GetFont(); |
281 | 285 |
282 // Take control of the PRIMARY selection clipboard with |text|. Use | 286 // Take control of the PRIMARY selection clipboard with |text|. Use |
283 // |text_buffer_| as the owner, so that this doesn't remove the selection on | 287 // |text_buffer_| as the owner, so that this doesn't remove the selection on |
284 // it. This makes use of the above callbacks. | 288 // it. This makes use of the above callbacks. |
285 void OwnPrimarySelection(const std::string& text); | 289 void OwnPrimarySelection(const std::string& text); |
286 | 290 |
287 // Gets the GTK_TEXT_WINDOW_WIDGET coordinates for |text_view_| that bound the | 291 // Gets the GTK_TEXT_WINDOW_WIDGET coordinates for |text_view_| that bound the |
288 // given iters. | 292 // given iters. |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 ui::GtkSignalRegistrar signals_; | 546 ui::GtkSignalRegistrar signals_; |
543 | 547 |
544 #if defined(TOOLKIT_VIEWS) | 548 #if defined(TOOLKIT_VIEWS) |
545 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; | 549 scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; |
546 #endif | 550 #endif |
547 | 551 |
548 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); | 552 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); |
549 }; | 553 }; |
550 | 554 |
551 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ | 555 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ |
OLD | NEW |