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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 registrar_.Add( | 161 registrar_.Add( |
162 this, | 162 this, |
163 content::NOTIFICATION_TAB_CONTENTS_DESTROYED, | 163 content::NOTIFICATION_TAB_CONTENTS_DESTROYED, |
164 content::Source<TabContents>(dragged_tab_data.contents_->tab_contents())); | 164 content::Source<TabContents>(dragged_tab_data.contents_->tab_contents())); |
165 return dragged_tab_data; | 165 return dragged_tab_data; |
166 } | 166 } |
167 | 167 |
168 //////////////////////////////////////////////////////////////////////////////// | 168 //////////////////////////////////////////////////////////////////////////////// |
169 // DraggedTabControllerGtk, TabContentsDelegate implementation: | 169 // DraggedTabControllerGtk, TabContentsDelegate implementation: |
170 | 170 |
171 // TODO(adriansc): Remove this method once refactoring has changed all call | |
172 // sites. | |
173 TabContents* DraggedTabControllerGtk::OpenURLFromTab( | |
174 TabContents* source, | |
175 const GURL& url, | |
176 const GURL& referrer, | |
177 WindowOpenDisposition disposition, | |
178 content::PageTransition transition) { | |
179 return OpenURLFromTab(source, | |
180 OpenURLParams(url, referrer, disposition, transition, | |
181 false)); | |
182 } | |
183 | |
184 TabContents* DraggedTabControllerGtk::OpenURLFromTab( | 171 TabContents* DraggedTabControllerGtk::OpenURLFromTab( |
185 TabContents* source, | 172 TabContents* source, |
186 const OpenURLParams& params) { | 173 const OpenURLParams& params) { |
187 if (drag_data_->GetSourceTabData()->original_delegate_) { | 174 if (drag_data_->GetSourceTabData()->original_delegate_) { |
188 OpenURLParams forward_params = params; | 175 OpenURLParams forward_params = params; |
189 if (params.disposition == CURRENT_TAB) | 176 if (params.disposition == CURRENT_TAB) |
190 forward_params.disposition = NEW_WINDOW; | 177 forward_params.disposition = NEW_WINDOW; |
191 | 178 |
192 return drag_data_->GetSourceTabData()->original_delegate_-> | 179 return drag_data_->GetSourceTabData()->original_delegate_-> |
193 OpenURLFromTab(source, forward_params); | 180 OpenURLFromTab(source, forward_params); |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 | 883 |
897 bool DraggedTabControllerGtk::AreTabsConsecutive() { | 884 bool DraggedTabControllerGtk::AreTabsConsecutive() { |
898 for (size_t i = 1; i < drag_data_->size(); ++i) { | 885 for (size_t i = 1; i < drag_data_->size(); ++i) { |
899 if (drag_data_->get(i - 1)->source_model_index_ + 1 != | 886 if (drag_data_->get(i - 1)->source_model_index_ + 1 != |
900 drag_data_->get(i)->source_model_index_) { | 887 drag_data_->get(i)->source_model_index_) { |
901 return false; | 888 return false; |
902 } | 889 } |
903 } | 890 } |
904 return true; | 891 return true; |
905 } | 892 } |
OLD | NEW |