| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/gfx/path.h" | 10 #include "app/gfx/path.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return; | 220 return; |
| 221 | 221 |
| 222 if (drag_widget_) { | 222 if (drag_widget_) { |
| 223 delegate_->ContinueDrag(NULL); | 223 delegate_->ContinueDrag(NULL); |
| 224 return; | 224 return; |
| 225 } | 225 } |
| 226 | 226 |
| 227 GdkEventMotion* motion = reinterpret_cast<GdkEventMotion*>(event); | 227 GdkEventMotion* motion = reinterpret_cast<GdkEventMotion*>(event); |
| 228 GdkEventButton* button = reinterpret_cast<GdkEventButton*>(last_mouse_down_); | 228 GdkEventButton* button = reinterpret_cast<GdkEventButton*>(last_mouse_down_); |
| 229 bool dragging = gtk_drag_check_threshold(widget(), | 229 bool dragging = gtk_drag_check_threshold(widget(), |
| 230 button->x, button->y, | 230 static_cast<gint>(button->x), |
| 231 motion->x, motion->y); | 231 static_cast<gint>(button->y), |
| 232 if (dragging) | 232 static_cast<gint>(motion->x), |
| 233 StartDragging(gfx::Point(button->x, button->y)); | 233 static_cast<gint>(motion->y)); |
| 234 if (dragging) { |
| 235 StartDragging(gfx::Point(static_cast<int>(button->x), |
| 236 static_cast<int>(button->y))); |
| 237 } |
| 234 } | 238 } |
| 235 | 239 |
| 236 /////////////////////////////////////////////////////////////////////////////// | 240 /////////////////////////////////////////////////////////////////////////////// |
| 237 // TabGtk, TabRendererGtk overrides: | 241 // TabGtk, TabRendererGtk overrides: |
| 238 | 242 |
| 239 bool TabGtk::IsSelected() const { | 243 bool TabGtk::IsSelected() const { |
| 240 return delegate_->IsTabSelected(this); | 244 return delegate_->IsTabSelected(this); |
| 241 } | 245 } |
| 242 | 246 |
| 243 bool TabGtk::IsVisible() const { | 247 bool TabGtk::IsVisible() const { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 gdk_event_free(last_mouse_down_); | 333 gdk_event_free(last_mouse_down_); |
| 330 last_mouse_down_ = NULL; | 334 last_mouse_down_ = NULL; |
| 331 } | 335 } |
| 332 | 336 |
| 333 // Notify the drag helper that we're done with any potential drag operations. | 337 // Notify the drag helper that we're done with any potential drag operations. |
| 334 // Clean up the drag helper, which is re-created on the next mouse press. | 338 // Clean up the drag helper, which is re-created on the next mouse press. |
| 335 delegate_->EndDrag(canceled); | 339 delegate_->EndDrag(canceled); |
| 336 | 340 |
| 337 MessageLoopForUI::current()->RemoveObserver(this); | 341 MessageLoopForUI::current()->RemoveObserver(this); |
| 338 } | 342 } |
| OLD | NEW |