| 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 "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 gboolean HandleKeyRelease(GtkWidget* widget, GdkEventKey* event); | 126 gboolean HandleKeyRelease(GtkWidget* widget, GdkEventKey* event); |
| 127 | 127 |
| 128 static gboolean HandleViewButtonPressThunk(GtkWidget* view, | 128 static gboolean HandleViewButtonPressThunk(GtkWidget* view, |
| 129 GdkEventButton* event, | 129 GdkEventButton* event, |
| 130 gpointer self) { | 130 gpointer self) { |
| 131 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> | 131 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> |
| 132 HandleViewButtonPress(event); | 132 HandleViewButtonPress(event); |
| 133 } | 133 } |
| 134 gboolean HandleViewButtonPress(GdkEventButton* event); | 134 gboolean HandleViewButtonPress(GdkEventButton* event); |
| 135 | 135 |
| 136 static gboolean HandleViewButtonReleaseThunk(GtkWidget* view, |
| 137 GdkEventButton* event, |
| 138 gpointer self) { |
| 139 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> |
| 140 HandleViewButtonRelease(event); |
| 141 } |
| 142 gboolean HandleViewButtonRelease(GdkEventButton* event); |
| 143 |
| 136 static gboolean HandleViewFocusInThunk(GtkWidget* view, | 144 static gboolean HandleViewFocusInThunk(GtkWidget* view, |
| 137 GdkEventFocus* event, | 145 GdkEventFocus* event, |
| 138 gpointer self) { | 146 gpointer self) { |
| 139 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> | 147 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> |
| 140 HandleViewFocusIn(); | 148 HandleViewFocusIn(); |
| 141 } | 149 } |
| 142 gboolean HandleViewFocusIn(); | 150 gboolean HandleViewFocusIn(); |
| 143 | 151 |
| 144 static gboolean HandleViewFocusOutThunk(GtkWidget* view, | 152 static gboolean HandleViewFocusOutThunk(GtkWidget* view, |
| 145 GdkEventFocus* event, | 153 GdkEventFocus* event, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // it, we pass this string to SavePrimarySelection()). | 297 // it, we pass this string to SavePrimarySelection()). |
| 290 std::string selected_text_; | 298 std::string selected_text_; |
| 291 | 299 |
| 292 // Has the current value of |selected_text_| been saved as the PRIMARY | 300 // Has the current value of |selected_text_| been saved as the PRIMARY |
| 293 // selection? | 301 // selection? |
| 294 bool selection_saved_; | 302 bool selection_saved_; |
| 295 | 303 |
| 296 // ID of the signal handler for "mark-set" on |text_buffer_|. | 304 // ID of the signal handler for "mark-set" on |text_buffer_|. |
| 297 gulong mark_set_handler_id_; | 305 gulong mark_set_handler_id_; |
| 298 | 306 |
| 307 // Is the first mouse button currently down? |
| 308 bool button_1_pressed_; |
| 309 |
| 310 // Did the user change the selected text in the middle of the current click? |
| 311 // If so, we don't select all of the text when the button is released -- we |
| 312 // don't want to blow away their selection. |
| 313 bool text_selected_during_click_; |
| 314 |
| 315 // Was the text view already focused before the user clicked in it? We use |
| 316 // this to figure out whether we should select all of the text when the button |
| 317 // is released (we only do so if the view was initially unfocused). |
| 318 bool text_view_focused_before_button_press_; |
| 319 |
| 299 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); | 320 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); |
| 300 }; | 321 }; |
| 301 | 322 |
| 302 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ | 323 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ |
| OLD | NEW |