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

Side by Side Diff: chrome/browser/ui/panels/panel_drag_gtk.h

Issue 10266021: GTK Panels - fix crash when clicking on titlebar to restore a panel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add extra drag state to make code clearer Created 8 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_drag_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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_UI_PANELS_PANEL_DRAG_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_DRAG_GTK_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_DRAG_GTK_H_ 6 #define CHROME_BROWSER_UI_PANELS_PANEL_DRAG_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 30 matching lines...) Expand all
41 // |titlebar_widget| should handle the mouse release event if the mouse 41 // |titlebar_widget| should handle the mouse release event if the mouse
42 // is released without exceeding the drag threshold (a mouse click). 42 // is released without exceeding the drag threshold (a mouse click).
43 void InitialTitlebarMousePress(GdkEventButton* event, 43 void InitialTitlebarMousePress(GdkEventButton* event,
44 GtkWidget* titlebar_widget); 44 GtkWidget* titlebar_widget);
45 45
46 private: 46 private:
47 friend class NativePanelTestingGtk; 47 friend class NativePanelTestingGtk;
48 48
49 enum DragState { 49 enum DragState {
50 NOT_DRAGGING, 50 NOT_DRAGGING,
51 DRAG_IN_PROGRESS, 51 DRAG_CAN_START, // mouse pressed
52 DRAG_IN_PROGRESS, // mouse moved beyond drag threshold
52 DRAG_ENDED_WAITING_FOR_MOUSE_RELEASE 53 DRAG_ENDED_WAITING_FOR_MOUSE_RELEASE
53 }; 54 };
54 55
55 // Callbacks for GTK mouse and key events. 56 // Callbacks for GTK mouse and key events.
56 CHROMEGTK_CALLBACK_1(PanelDragGtk, gboolean, OnMouseMoveEvent, 57 CHROMEGTK_CALLBACK_1(PanelDragGtk, gboolean, OnMouseMoveEvent,
57 GdkEventMotion*); 58 GdkEventMotion*);
58 CHROMEGTK_CALLBACK_1(PanelDragGtk, gboolean, OnButtonPressEvent, 59 CHROMEGTK_CALLBACK_1(PanelDragGtk, gboolean, OnButtonPressEvent,
59 GdkEventButton*); 60 GdkEventButton*);
60 CHROMEGTK_CALLBACK_1(PanelDragGtk, gboolean, OnButtonReleaseEvent, 61 CHROMEGTK_CALLBACK_1(PanelDragGtk, gboolean, OnButtonReleaseEvent,
61 GdkEventButton*); 62 GdkEventButton*);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // handling is necessary. 98 // handling is necessary.
98 GtkWidget* click_handler_; 99 GtkWidget* click_handler_;
99 100
100 // Delegate for processing drag depends on actual type of drag. 101 // Delegate for processing drag depends on actual type of drag.
101 PanelDragDelegate* drag_delegate_; 102 PanelDragDelegate* drag_delegate_;
102 103
103 DISALLOW_COPY_AND_ASSIGN(PanelDragGtk); 104 DISALLOW_COPY_AND_ASSIGN(PanelDragGtk);
104 }; 105 };
105 106
106 #endif // CHROME_BROWSER_UI_PANELS_PANEL_DRAG_GTK_H_ 107 #endif // CHROME_BROWSER_UI_PANELS_PANEL_DRAG_GTK_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_drag_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698