OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/dragged_tab_controller_gtk.h" | 5 #include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 // TabContents. We must now create one. | 421 // TabContents. We must now create one. |
422 | 422 |
423 // Remove ourselves as the delegate now that the dragged TabContents is | 423 // Remove ourselves as the delegate now that the dragged TabContents is |
424 // being inserted back into a Browser. | 424 // being inserted back into a Browser. |
425 for (size_t i = 0; i < drag_data_->size(); ++i) { | 425 for (size_t i = 0; i < drag_data_->size(); ++i) { |
426 drag_data_->get(i)->contents_->tab_contents()->SetDelegate(NULL); | 426 drag_data_->get(i)->contents_->tab_contents()->SetDelegate(NULL); |
427 drag_data_->get(i)->original_delegate_ = NULL; | 427 drag_data_->get(i)->original_delegate_ = NULL; |
428 } | 428 } |
429 | 429 |
430 // Return the TabContents' to normalcy. | 430 // Return the TabContents' to normalcy. |
431 drag_data_->GetSourceTabContents()->set_capturing_contents(false); | 431 drag_data_->GetSourceTabContents()->SetCapturingContents(false); |
432 | 432 |
433 // We need to ask the tabstrip we're attached to ensure that the ideal | 433 // We need to ask the tabstrip we're attached to ensure that the ideal |
434 // bounds for all its tabs are correctly generated, because the calculation | 434 // bounds for all its tabs are correctly generated, because the calculation |
435 // in GetInsertionIndexForDraggedBounds needs them to be to figure out the | 435 // in GetInsertionIndexForDraggedBounds needs them to be to figure out the |
436 // appropriate insertion index. | 436 // appropriate insertion index. |
437 attached_tabstrip_->GenerateIdealBounds(); | 437 attached_tabstrip_->GenerateIdealBounds(); |
438 | 438 |
439 // Inserting counts as a move. We don't want the tabs to jitter when the | 439 // Inserting counts as a move. We don't want the tabs to jitter when the |
440 // user moves the tab immediately after attaching it. | 440 // user moves the tab immediately after attaching it. |
441 last_move_screen_x_ = screen_point.x(); | 441 last_move_screen_x_ = screen_point.x(); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 | 884 |
885 bool DraggedTabControllerGtk::AreTabsConsecutive() { | 885 bool DraggedTabControllerGtk::AreTabsConsecutive() { |
886 for (size_t i = 1; i < drag_data_->size(); ++i) { | 886 for (size_t i = 1; i < drag_data_->size(); ++i) { |
887 if (drag_data_->get(i - 1)->source_model_index_ + 1 != | 887 if (drag_data_->get(i - 1)->source_model_index_ + 1 != |
888 drag_data_->get(i)->source_model_index_) { | 888 drag_data_->get(i)->source_model_index_) { |
889 return false; | 889 return false; |
890 } | 890 } |
891 } | 891 } |
892 return true; | 892 return true; |
893 } | 893 } |
OLD | NEW |