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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 548703002: Fixes possible crash in tab dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | 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/views/tabs/tab_drag_controller.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 // enough to trigger a drag. 1351 // enough to trigger a drag.
1352 if (started_drag_) { 1352 if (started_drag_) {
1353 RestoreFocus(); 1353 RestoreFocus();
1354 if (type == CANCELED) 1354 if (type == CANCELED)
1355 RevertDrag(); 1355 RevertDrag();
1356 else 1356 else
1357 CompleteDrag(); 1357 CompleteDrag();
1358 } 1358 }
1359 } else if (drag_data_.size() > 1) { 1359 } else if (drag_data_.size() > 1) {
1360 initial_selection_model_.Clear(); 1360 initial_selection_model_.Clear();
1361 RevertDrag(); 1361 if (started_drag_)
1362 RevertDrag();
1362 } // else case the only tab we were dragging was deleted. Nothing to do. 1363 } // else case the only tab we were dragging was deleted. Nothing to do.
1363 1364
1364 // Clear out drag data so we don't attempt to do anything with it. 1365 // Clear out drag data so we don't attempt to do anything with it.
1365 drag_data_.clear(); 1366 drag_data_.clear();
1366 1367
1367 TabStrip* owning_tabstrip = attached_tabstrip_ ? 1368 TabStrip* owning_tabstrip = attached_tabstrip_ ?
1368 attached_tabstrip_ : source_tabstrip_; 1369 attached_tabstrip_ : source_tabstrip_;
1369 owning_tabstrip->DestroyDragController(); 1370 owning_tabstrip->DestroyDragController();
1370 } 1371 }
1371 1372
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1785 it != browser_list->end(); ++it) { 1786 it != browser_list->end(); ++it) {
1786 if ((*it)->tab_strip_model()->empty()) 1787 if ((*it)->tab_strip_model()->empty())
1787 exclude.insert((*it)->window()->GetNativeWindow()); 1788 exclude.insert((*it)->window()->GetNativeWindow());
1788 } 1789 }
1789 #endif 1790 #endif
1790 return GetLocalProcessWindowAtPoint(host_desktop_type_, 1791 return GetLocalProcessWindowAtPoint(host_desktop_type_,
1791 screen_point, 1792 screen_point,
1792 exclude); 1793 exclude);
1793 1794
1794 } 1795 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698