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/views/tabs/default_tab_drag_controller.h" | 5 #include "chrome/browser/ui/views/tabs/default_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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 EndDragImpl(canceled ? CANCELED : NORMAL); | 401 EndDragImpl(canceled ? CANCELED : NORMAL); |
402 } | 402 } |
403 | 403 |
404 bool DefaultTabDragController::GetStartedDrag() const { | 404 bool DefaultTabDragController::GetStartedDrag() const { |
405 return started_drag_; | 405 return started_drag_; |
406 } | 406 } |
407 | 407 |
408 /////////////////////////////////////////////////////////////////////////////// | 408 /////////////////////////////////////////////////////////////////////////////// |
409 // DefaultTabDragController, PageNavigator implementation: | 409 // DefaultTabDragController, PageNavigator implementation: |
410 | 410 |
411 // TODO(adriansc): Remove this method once refactoring changed all call sites. | |
412 TabContents* DefaultTabDragController::OpenURLFromTab( | |
413 TabContents* source, | |
414 const GURL& url, | |
415 const GURL& referrer, | |
416 WindowOpenDisposition disposition, | |
417 content::PageTransition transition) { | |
418 return OpenURLFromTab(source, | |
419 OpenURLParams(url, referrer, disposition, transition, | |
420 false)); | |
421 } | |
422 | |
423 TabContents* DefaultTabDragController::OpenURLFromTab(TabContents* source, | 411 TabContents* DefaultTabDragController::OpenURLFromTab(TabContents* source, |
424 const OpenURLParams& params) { | 412 const OpenURLParams& params) { |
425 if (source_tab_drag_data()->original_delegate) { | 413 if (source_tab_drag_data()->original_delegate) { |
426 OpenURLParams forward_params = params; | 414 OpenURLParams forward_params = params; |
427 if (params.disposition == CURRENT_TAB) | 415 if (params.disposition == CURRENT_TAB) |
428 forward_params.disposition = NEW_WINDOW; | 416 forward_params.disposition = NEW_WINDOW; |
429 | 417 |
430 return source_tab_drag_data()->original_delegate->OpenURLFromTab( | 418 return source_tab_drag_data()->original_delegate->OpenURLFromTab( |
431 source, forward_params); | 419 source, forward_params); |
432 } | 420 } |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1422 controller->Init(source_tabstrip, source_tab, tabs, mouse_offset, | 1410 controller->Init(source_tabstrip, source_tab, tabs, mouse_offset, |
1423 source_tab_offset, initial_selection_model); | 1411 source_tab_offset, initial_selection_model); |
1424 return controller; | 1412 return controller; |
1425 } | 1413 } |
1426 | 1414 |
1427 // static | 1415 // static |
1428 bool TabDragController::IsAttachedTo(BaseTabStrip* tab_strip) { | 1416 bool TabDragController::IsAttachedTo(BaseTabStrip* tab_strip) { |
1429 return instance_ && instance_->active()&& | 1417 return instance_ && instance_->active()&& |
1430 instance_->attached_tabstrip() == tab_strip; | 1418 instance_->attached_tabstrip() == tab_strip; |
1431 } | 1419 } |
OLD | NEW |