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

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

Issue 10822022: Added extra DCHECK() to eliminate possible NULL deref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove .gitmodule Created 8 years, 4 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 | 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/callback.h" 10 #include "base/callback.h"
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 } 1603 }
1604 } 1604 }
1605 } 1605 }
1606 if (!has_one_valid_tab) 1606 if (!has_one_valid_tab)
1607 return; 1607 return;
1608 1608
1609 model->SetSelectionFromModel(selection_model); 1609 model->SetSelectionFromModel(selection_model);
1610 } 1610 }
1611 1611
1612 void TabDragController::RevertDragAt(size_t drag_index) { 1612 void TabDragController::RevertDragAt(size_t drag_index) {
1613 DCHECK(started_drag_); 1613 DCHECK(started_drag_ && source_tabstrip_);
James Hawkins 2012/07/26 00:10:50 nit: Don't put two conditions in one DCHECK, other
1614 1614
1615 TabDragData* data = &(drag_data_[drag_index]); 1615 TabDragData* data = &(drag_data_[drag_index]);
1616 if (attached_tabstrip_) { 1616 if (attached_tabstrip_) {
1617 int index = 1617 int index =
1618 GetModel(attached_tabstrip_)->GetIndexOfTabContents(data->contents); 1618 GetModel(attached_tabstrip_)->GetIndexOfTabContents(data->contents);
1619 if (attached_tabstrip_ != source_tabstrip_) { 1619 if (attached_tabstrip_ != source_tabstrip_) {
1620 // The Tab was inserted into another TabStrip. We need to put it back 1620 // The Tab was inserted into another TabStrip. We need to put it back
1621 // into the original one. 1621 // into the original one.
1622 GetModel(attached_tabstrip_)->DetachTabContentsAt(index); 1622 GetModel(attached_tabstrip_)->DetachTabContentsAt(index);
1623 // TODO(beng): (Cleanup) seems like we should use Attach() for this 1623 // TODO(beng): (Cleanup) seems like we should use Attach() for this
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 gfx::Point touch_point; 1922 gfx::Point touch_point;
1923 bool got_touch_point = widget_window->GetRootWindow()-> 1923 bool got_touch_point = widget_window->GetRootWindow()->
1924 gesture_recognizer()->GetLastTouchPointForTarget(widget_window, 1924 gesture_recognizer()->GetLastTouchPointForTarget(widget_window,
1925 &touch_point); 1925 &touch_point);
1926 DCHECK(got_touch_point); 1926 DCHECK(got_touch_point);
1927 return touch_point; 1927 return touch_point;
1928 } 1928 }
1929 #endif 1929 #endif
1930 return gfx::Screen::GetCursorScreenPoint(); 1930 return gfx::Screen::GetCursorScreenPoint();
1931 } 1931 }
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