| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/gtk/tabs/tab_gtk.h" | 5 #include "chrome/browser/gtk/tabs/tab_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
| 10 #include "app/menus/accelerator_gtk.h" | 10 #include "app/menus/accelerator_gtk.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 g_signal_connect(event_box_, "button-press-event", | 145 g_signal_connect(event_box_, "button-press-event", |
| 146 G_CALLBACK(OnButtonPressEventThunk), this); | 146 G_CALLBACK(OnButtonPressEventThunk), this); |
| 147 g_signal_connect(event_box_, "button-release-event", | 147 g_signal_connect(event_box_, "button-release-event", |
| 148 G_CALLBACK(OnButtonReleaseEventThunk), this); | 148 G_CALLBACK(OnButtonReleaseEventThunk), this); |
| 149 g_signal_connect(event_box_, "enter-notify-event", | 149 g_signal_connect(event_box_, "enter-notify-event", |
| 150 G_CALLBACK(OnEnterNotifyEventThunk), this); | 150 G_CALLBACK(OnEnterNotifyEventThunk), this); |
| 151 g_signal_connect(event_box_, "leave-notify-event", | 151 g_signal_connect(event_box_, "leave-notify-event", |
| 152 G_CALLBACK(OnLeaveNotifyEventThunk), this); | 152 G_CALLBACK(OnLeaveNotifyEventThunk), this); |
| 153 gtk_widget_add_events(event_box_, | 153 gtk_widget_add_events(event_box_, |
| 154 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | | 154 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | |
| 155 GDK_LEAVE_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); | 155 GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); |
| 156 gtk_container_add(GTK_CONTAINER(event_box_), TabRendererGtk::widget()); | 156 gtk_container_add(GTK_CONTAINER(event_box_), TabRendererGtk::widget()); |
| 157 gtk_widget_show_all(event_box_); | 157 gtk_widget_show_all(event_box_); |
| 158 } | 158 } |
| 159 | 159 |
| 160 TabGtk::~TabGtk() { | 160 TabGtk::~TabGtk() { |
| 161 if (drag_widget_) { | 161 if (drag_widget_) { |
| 162 // Shadow the drag grab so the grab terminates. We could do this using any | 162 // Shadow the drag grab so the grab terminates. We could do this using any |
| 163 // widget, |drag_widget_| is just convenient. | 163 // widget, |drag_widget_| is just convenient. |
| 164 gtk_grab_add(drag_widget_); | 164 gtk_grab_add(drag_widget_); |
| 165 gtk_grab_remove(drag_widget_); | 165 gtk_grab_remove(drag_widget_); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 gdk_event_free(last_mouse_down_); | 399 gdk_event_free(last_mouse_down_); |
| 400 last_mouse_down_ = NULL; | 400 last_mouse_down_ = NULL; |
| 401 } | 401 } |
| 402 | 402 |
| 403 // Notify the drag helper that we're done with any potential drag operations. | 403 // Notify the drag helper that we're done with any potential drag operations. |
| 404 // Clean up the drag helper, which is re-created on the next mouse press. | 404 // Clean up the drag helper, which is re-created on the next mouse press. |
| 405 delegate_->EndDrag(canceled); | 405 delegate_->EndDrag(canceled); |
| 406 | 406 |
| 407 observer_.reset(); | 407 observer_.reset(); |
| 408 } | 408 } |
| OLD | NEW |