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

Side by Side Diff: chrome/browser/ui/gtk/tabs/tab_gtk.cc

Issue 10809087: Merge 147513 - Change variable name to avoid scoping issues. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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/gtk/tabs/tab_strip_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 #include "chrome/browser/ui/gtk/tabs/tab_gtk.h" 5 #include "chrome/browser/ui/gtk/tabs/tab_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 319 }
320 320
321 void TabGtk::DestroyDragWidget() { 321 void TabGtk::DestroyDragWidget() {
322 if (drag_widget_) { 322 if (drag_widget_) {
323 gtk_widget_destroy(drag_widget_); 323 gtk_widget_destroy(drag_widget_);
324 drag_widget_ = NULL; 324 drag_widget_ = NULL;
325 } 325 }
326 } 326 }
327 327
328 void TabGtk::StartDragging(gfx::Point drag_offset) { 328 void TabGtk::StartDragging(gfx::Point drag_offset) {
329 // If the drag is processed after the selection change it's possible
330 // that the tab has been deselected, in which case we don't want to drag.
331 if (!IsSelected())
332 return;
333
329 CreateDragWidget(); 334 CreateDragWidget();
330 335
331 GtkTargetList* list = ui::GetTargetListFromCodeMask(ui::CHROME_TAB); 336 GtkTargetList* list = ui::GetTargetListFromCodeMask(ui::CHROME_TAB);
332 gtk_drag_begin(drag_widget_, list, GDK_ACTION_MOVE, 337 gtk_drag_begin(drag_widget_, list, GDK_ACTION_MOVE,
333 1, // Drags are always initiated by the left button. 338 1, // Drags are always initiated by the left button.
334 last_mouse_down_); 339 last_mouse_down_);
335 // gtk_drag_begin adds a reference to list, so unref it here. 340 // gtk_drag_begin adds a reference to list, so unref it here.
336 gtk_target_list_unref(list); 341 gtk_target_list_unref(list);
337 delegate_->MaybeStartDrag(this, drag_offset); 342 delegate_->MaybeStartDrag(this, drag_offset);
338 } 343 }
(...skipping 14 matching lines...) Expand all
353 gdk_event_free(last_mouse_down_); 358 gdk_event_free(last_mouse_down_);
354 last_mouse_down_ = NULL; 359 last_mouse_down_ = NULL;
355 } 360 }
356 361
357 // Notify the drag helper that we're done with any potential drag operations. 362 // Notify the drag helper that we're done with any potential drag operations.
358 // Clean up the drag helper, which is re-created on the next mouse press. 363 // Clean up the drag helper, which is re-created on the next mouse press.
359 delegate_->EndDrag(canceled); 364 delegate_->EndDrag(canceled);
360 365
361 observer_.reset(); 366 observer_.reset();
362 } 367 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698