| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> |
| 11 |
| 10 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 11 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 12 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 13 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 15 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
| 14 #include "chrome/browser/toolbar_model.h" | 16 #include "chrome/browser/toolbar_model.h" |
| 15 #include "chrome/common/notification_observer.h" | 17 #include "chrome/common/notification_observer.h" |
| 16 #include "chrome/common/notification_registrar.h" | 18 #include "chrome/common/notification_registrar.h" |
| 17 #include "chrome/common/owned_widget_gtk.h" | 19 #include "chrome/common/owned_widget_gtk.h" |
| 18 #include "chrome/common/page_transition_types.h" | 20 #include "chrome/common/page_transition_types.h" |
| 19 #include "webkit/glue/window_open_disposition.h" | 21 #include "webkit/glue/window_open_disposition.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 guint time, | 246 guint time, |
| 245 gpointer self) { | 247 gpointer self) { |
| 246 reinterpret_cast<AutocompleteEditViewGtk*>(self)-> | 248 reinterpret_cast<AutocompleteEditViewGtk*>(self)-> |
| 247 HandleDragDataReceived(context, x, y, selection_data, target_type, | 249 HandleDragDataReceived(context, x, y, selection_data, target_type, |
| 248 time); | 250 time); |
| 249 } | 251 } |
| 250 void HandleDragDataReceived(GdkDragContext* context, gint x, gint y, | 252 void HandleDragDataReceived(GdkDragContext* context, gint x, gint y, |
| 251 GtkSelectionData* selection_data, | 253 GtkSelectionData* selection_data, |
| 252 guint target_type, guint time); | 254 guint target_type, guint time); |
| 253 | 255 |
| 256 static void HandleInsertTextThunk(GtkTextBuffer* buffer, |
| 257 GtkTextIter* location, |
| 258 const gchar* text, |
| 259 gint len, |
| 260 gpointer self) { |
| 261 reinterpret_cast<AutocompleteEditViewGtk*>(self)-> |
| 262 HandleInsertText(buffer, location, text, len); |
| 263 } |
| 264 void HandleInsertText(GtkTextBuffer* buffer, |
| 265 GtkTextIter* location, |
| 266 const gchar* text, |
| 267 gint len); |
| 268 |
| 269 static void HandleBackSpaceThunk(GtkTextView* text_view, gpointer self) { |
| 270 reinterpret_cast<AutocompleteEditViewGtk*>(self)->HandleBackSpace(); |
| 271 } |
| 272 void HandleBackSpace(); |
| 273 |
| 254 // Actual implementation of SelectAll(), but also provides control over | 274 // Actual implementation of SelectAll(), but also provides control over |
| 255 // whether the PRIMARY selection is set to the selected text (in SelectAll(), | 275 // whether the PRIMARY selection is set to the selected text (in SelectAll(), |
| 256 // it isn't, but we want set the selection when the user clicks in the entry). | 276 // it isn't, but we want set the selection when the user clicks in the entry). |
| 257 void SelectAllInternal(bool reversed, bool update_primary_selection); | 277 void SelectAllInternal(bool reversed, bool update_primary_selection); |
| 258 | 278 |
| 259 // Get ready to update |text_buffer_|'s highlighting without making changes to | 279 // Get ready to update |text_buffer_|'s highlighting without making changes to |
| 260 // the PRIMARY selection. Removes the clipboard from |text_buffer_| and | 280 // the PRIMARY selection. Removes the clipboard from |text_buffer_| and |
| 261 // blocks the "mark-set" signal handler. | 281 // blocks the "mark-set" signal handler. |
| 262 void StartUpdatingHighlightedText(); | 282 void StartUpdatingHighlightedText(); |
| 263 | 283 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // Supplies colors, et cetera. | 371 // Supplies colors, et cetera. |
| 352 GtkThemeProvider* theme_provider_; | 372 GtkThemeProvider* theme_provider_; |
| 353 | 373 |
| 354 NotificationRegistrar registrar_; | 374 NotificationRegistrar registrar_; |
| 355 #endif | 375 #endif |
| 356 | 376 |
| 357 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); | 377 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); |
| 358 }; | 378 }; |
| 359 | 379 |
| 360 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ | 380 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ |
| OLD | NEW |