| OLD | NEW |
| 1 // Copyright (c) 2011 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_BROWSER_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 10 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 11 #include "chrome/browser/ui/gtk/menu_gtk.h" | 11 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 bool system_drag_disabled_for_testing_; | 150 bool system_drag_disabled_for_testing_; |
| 151 | 151 |
| 152 // A copy of the last button press event, used to initiate a drag. | 152 // A copy of the last button press event, used to initiate a drag. |
| 153 GdkEvent* last_mouse_down_; | 153 GdkEvent* last_mouse_down_; |
| 154 | 154 |
| 155 // A GtkInivisible used to track the drag event. GtkInvisibles are of the | 155 // A GtkInivisible used to track the drag event. GtkInvisibles are of the |
| 156 // type GInitiallyUnowned, but the widget initialization code sinks the | 156 // type GInitiallyUnowned, but the widget initialization code sinks the |
| 157 // reference, so we can't use an OwnedWidgetGtk here. | 157 // reference, so we can't use an OwnedWidgetGtk here. |
| 158 GtkWidget* drag_widget_; | 158 GtkWidget* drag_widget_; |
| 159 | 159 |
| 160 // Used to destroy the drag widget after a return to the message loop. | |
| 161 ScopedRunnableMethodFactory<PanelBrowserWindowGtk> | |
| 162 destroy_drag_widget_factory_; | |
| 163 | |
| 164 // Due to a bug in GTK+, we need to force the end of a drag when we get a | 160 // Due to a bug in GTK+, we need to force the end of a drag when we get a |
| 165 // mouse release event on the the dragged widget, otherwise, we don't know | 161 // mouse release event on the the dragged widget, otherwise, we don't know |
| 166 // when the drag has ended when the user presses space or enter. We queue | 162 // when the drag has ended when the user presses space or enter. We queue |
| 167 // a task to end the drag and only run it if GTK+ didn't send us the | 163 // a task to end the drag and only run it if GTK+ didn't send us the |
| 168 // drag-failed event. | 164 // drag-failed event. |
| 169 base::WeakPtrFactory<PanelBrowserWindowGtk> drag_end_factory_; | 165 base::WeakPtrFactory<PanelBrowserWindowGtk> drag_end_factory_; |
| 170 | 166 |
| 171 scoped_ptr<Panel> panel_; | 167 scoped_ptr<Panel> panel_; |
| 172 gfx::Rect bounds_; | 168 gfx::Rect bounds_; |
| 173 | 169 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 196 // This records the bounds set on the last animation progress notification. | 192 // This records the bounds set on the last animation progress notification. |
| 197 // We need this for the case where a new bounds animation starts before the | 193 // We need this for the case where a new bounds animation starts before the |
| 198 // current one completes. In this case, we want to start the new animation | 194 // current one completes. In this case, we want to start the new animation |
| 199 // from where the last one left. | 195 // from where the last one left. |
| 200 gfx::Rect last_animation_progressed_bounds_; | 196 gfx::Rect last_animation_progressed_bounds_; |
| 201 | 197 |
| 202 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); | 198 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk); |
| 203 }; | 199 }; |
| 204 | 200 |
| 205 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ | 201 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_ |
| OLD | NEW |