OLD | NEW |
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/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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 // There is no tab in |attached_tabstrip| that corresponds to the dragged | 428 // There is no tab in |attached_tabstrip| that corresponds to the dragged |
429 // WebContents. We must now create one. | 429 // WebContents. We must now create one. |
430 | 430 |
431 // Remove ourselves as the delegate now that the dragged WebContents | 431 // Remove ourselves as the delegate now that the dragged WebContents |
432 // is being inserted back into a Browser. | 432 // is being inserted back into a Browser. |
433 for (size_t i = 0; i < drag_data_->size(); ++i) { | 433 for (size_t i = 0; i < drag_data_->size(); ++i) { |
434 drag_data_->get(i)->contents_->SetDelegate(NULL); | 434 drag_data_->get(i)->contents_->SetDelegate(NULL); |
435 drag_data_->get(i)->original_delegate_ = NULL; | 435 drag_data_->get(i)->original_delegate_ = NULL; |
436 } | 436 } |
437 | 437 |
438 // Return the WebContents to normalcy. | |
439 drag_data_->GetSourceWebContents()->SetCapturingContents(false); | |
440 | |
441 // We need to ask the tabstrip we're attached to ensure that the ideal | 438 // We need to ask the tabstrip we're attached to ensure that the ideal |
442 // bounds for all its tabs are correctly generated, because the calculation | 439 // bounds for all its tabs are correctly generated, because the calculation |
443 // in GetInsertionIndexForDraggedBounds needs them to be to figure out the | 440 // in GetInsertionIndexForDraggedBounds needs them to be to figure out the |
444 // appropriate insertion index. | 441 // appropriate insertion index. |
445 attached_tabstrip_->GenerateIdealBounds(); | 442 attached_tabstrip_->GenerateIdealBounds(); |
446 | 443 |
447 // Inserting counts as a move. We don't want the tabs to jitter when the | 444 // Inserting counts as a move. We don't want the tabs to jitter when the |
448 // user moves the tab immediately after attaching it. | 445 // user moves the tab immediately after attaching it. |
449 last_move_screen_x_ = screen_point.x(); | 446 last_move_screen_x_ = screen_point.x(); |
450 | 447 |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 | 878 |
882 bool DraggedTabControllerGtk::AreTabsConsecutive() { | 879 bool DraggedTabControllerGtk::AreTabsConsecutive() { |
883 for (size_t i = 1; i < drag_data_->size(); ++i) { | 880 for (size_t i = 1; i < drag_data_->size(); ++i) { |
884 if (drag_data_->get(i - 1)->source_model_index_ + 1 != | 881 if (drag_data_->get(i - 1)->source_model_index_ + 1 != |
885 drag_data_->get(i)->source_model_index_) { | 882 drag_data_->get(i)->source_model_index_) { |
886 return false; | 883 return false; |
887 } | 884 } |
888 } | 885 } |
889 return true; | 886 return true; |
890 } | 887 } |
OLD | NEW |