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

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

Issue 342069: Linux: Re-enable omnibox select-all-on-click for Chrome OS builds. (Closed)
Patch Set: ifdef button press and release handlers Created 11 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 10 #include <string>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 gboolean HandleKeyPress(GtkWidget* widget, GdkEventKey* event); 140 gboolean HandleKeyPress(GtkWidget* widget, GdkEventKey* event);
141 141
142 static gboolean HandleKeyReleaseThunk(GtkWidget* widget, 142 static gboolean HandleKeyReleaseThunk(GtkWidget* widget,
143 GdkEventKey* event, 143 GdkEventKey* event,
144 gpointer self) { 144 gpointer self) {
145 return reinterpret_cast<AutocompleteEditViewGtk*>(self)->HandleKeyRelease( 145 return reinterpret_cast<AutocompleteEditViewGtk*>(self)->HandleKeyRelease(
146 widget, event); 146 widget, event);
147 } 147 }
148 gboolean HandleKeyRelease(GtkWidget* widget, GdkEventKey* event); 148 gboolean HandleKeyRelease(GtkWidget* widget, GdkEventKey* event);
149 149
150 #if defined(OS_CHROMEOS)
150 static gboolean HandleViewButtonPressThunk(GtkWidget* view, 151 static gboolean HandleViewButtonPressThunk(GtkWidget* view,
151 GdkEventButton* event, 152 GdkEventButton* event,
152 gpointer self) { 153 gpointer self) {
153 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> 154 return reinterpret_cast<AutocompleteEditViewGtk*>(self)->
154 HandleViewButtonPress(event); 155 HandleViewButtonPress(event);
155 } 156 }
156 gboolean HandleViewButtonPress(GdkEventButton* event); 157 gboolean HandleViewButtonPress(GdkEventButton* event);
157 158
158 static gboolean HandleViewButtonReleaseThunk(GtkWidget* view, 159 static gboolean HandleViewButtonReleaseThunk(GtkWidget* view,
159 GdkEventButton* event, 160 GdkEventButton* event,
160 gpointer self) { 161 gpointer self) {
161 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> 162 return reinterpret_cast<AutocompleteEditViewGtk*>(self)->
162 HandleViewButtonRelease(event); 163 HandleViewButtonRelease(event);
163 } 164 }
164 gboolean HandleViewButtonRelease(GdkEventButton* event); 165 gboolean HandleViewButtonRelease(GdkEventButton* event);
166 #endif
165 167
166 static gboolean HandleViewFocusInThunk(GtkWidget* view, 168 static gboolean HandleViewFocusInThunk(GtkWidget* view,
167 GdkEventFocus* event, 169 GdkEventFocus* event,
168 gpointer self) { 170 gpointer self) {
169 return reinterpret_cast<AutocompleteEditViewGtk*>(self)-> 171 return reinterpret_cast<AutocompleteEditViewGtk*>(self)->
170 HandleViewFocusIn(); 172 HandleViewFocusIn();
171 } 173 }
172 gboolean HandleViewFocusIn(); 174 gboolean HandleViewFocusIn();
173 175
174 static gboolean HandleViewFocusOutThunk(GtkWidget* view, 176 static gboolean HandleViewFocusOutThunk(GtkWidget* view,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 // The most-recently-selected text from the entry. This is updated on-the-fly 378 // The most-recently-selected text from the entry. This is updated on-the-fly
377 // as the user selects text. It is used in cases where we need to make the 379 // as the user selects text. It is used in cases where we need to make the
378 // PRIMARY selection persist even after the user has unhighlighted the text in 380 // PRIMARY selection persist even after the user has unhighlighted the text in
379 // the view (e.g. when they highlight some text and then click to unhighlight 381 // the view (e.g. when they highlight some text and then click to unhighlight
380 // it, we pass this string to SavePrimarySelection()). 382 // it, we pass this string to SavePrimarySelection()).
381 std::string selected_text_; 383 std::string selected_text_;
382 384
383 // ID of the signal handler for "mark-set" on |text_buffer_|. 385 // ID of the signal handler for "mark-set" on |text_buffer_|.
384 gulong mark_set_handler_id_; 386 gulong mark_set_handler_id_;
385 387
388 #if defined(OS_CHROMEOS)
389 // The following variables are used to implement select-all-on-mouse-up, which
390 // is disabled in the standard Linux build due to poor interaction with the
391 // PRIMARY X selection.
392
393 // Is the first mouse button currently down? When selection marks get moved,
394 // we use this to determine if the user was highlighting text with the mouse
395 // -- if so, we avoid selecting all the text on mouse-up.
396 bool button_1_pressed_;
397
398 // Did the user change the selected text in the middle of the current click?
399 // If so, we don't select all of the text when the button is released -- we
400 // don't want to blow away their selection.
401 bool text_selected_during_click_;
402
403 // Was the text view already focused before the user clicked in it? We use
404 // this to figure out whether we should select all of the text when the button
405 // is released (we only do so if the view was initially unfocused).
406 bool text_view_focused_before_button_press_;
407 #endif
408
386 #if !defined(TOOLKIT_VIEWS) 409 #if !defined(TOOLKIT_VIEWS)
387 // Supplies colors, et cetera. 410 // Supplies colors, et cetera.
388 GtkThemeProvider* theme_provider_; 411 GtkThemeProvider* theme_provider_;
389 412
390 NotificationRegistrar registrar_; 413 NotificationRegistrar registrar_;
391 #endif 414 #endif
392 415
393 // Indicates if Enter key was pressed. 416 // Indicates if Enter key was pressed.
394 // 417 //
395 // It's used in the key press handler to detect an Enter key press event 418 // It's used in the key press handler to detect an Enter key press event
(...skipping 24 matching lines...) Expand all
420 443
421 // Contains the character range that should have a strikethrough (used for 444 // Contains the character range that should have a strikethrough (used for
422 // insecure schemes). If the range is size one or less, no strikethrough 445 // insecure schemes). If the range is size one or less, no strikethrough
423 // is needed. 446 // is needed.
424 CharRange strikethrough_; 447 CharRange strikethrough_;
425 448
426 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk); 449 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewGtk);
427 }; 450 };
428 451
429 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_ 452 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_GTK_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698