| 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/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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 } | 555 } |
| 556 if (view_.get()) | 556 if (view_.get()) |
| 557 view_->Update(); | 557 view_->Update(); |
| 558 } | 558 } |
| 559 | 559 |
| 560 void TabDragController::AddNewContents(WebContents* source, | 560 void TabDragController::AddNewContents(WebContents* source, |
| 561 WebContents* new_contents, | 561 WebContents* new_contents, |
| 562 WindowOpenDisposition disposition, | 562 WindowOpenDisposition disposition, |
| 563 const gfx::Rect& initial_pos, | 563 const gfx::Rect& initial_pos, |
| 564 bool user_gesture) { | 564 bool user_gesture, |
| 565 bool* was_blocked) { |
| 565 DCHECK_NE(CURRENT_TAB, disposition); | 566 DCHECK_NE(CURRENT_TAB, disposition); |
| 566 | 567 |
| 567 // Theoretically could be called while dragging if the page tries to | 568 // Theoretically could be called while dragging if the page tries to |
| 568 // spawn a window. Route this message back to the browser in most cases. | 569 // spawn a window. Route this message back to the browser in most cases. |
| 569 if (source_tab_drag_data()->original_delegate) { | 570 if (source_tab_drag_data()->original_delegate) { |
| 570 source_tab_drag_data()->original_delegate->AddNewContents( | 571 source_tab_drag_data()->original_delegate->AddNewContents( |
| 571 source, new_contents, disposition, initial_pos, user_gesture); | 572 source, new_contents, disposition, initial_pos, user_gesture, |
| 573 was_blocked); |
| 572 } | 574 } |
| 573 } | 575 } |
| 574 | 576 |
| 575 void TabDragController::LoadingStateChanged(WebContents* source) { | 577 void TabDragController::LoadingStateChanged(WebContents* source) { |
| 576 // It would be nice to respond to this message by changing the | 578 // It would be nice to respond to this message by changing the |
| 577 // screen shot in the dragged tab. | 579 // screen shot in the dragged tab. |
| 578 if (view_.get()) | 580 if (view_.get()) |
| 579 view_->Update(); | 581 view_->Update(); |
| 580 } | 582 } |
| 581 | 583 |
| (...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1981 gfx::Point TabDragController::GetWindowOffset( | 1983 gfx::Point TabDragController::GetWindowOffset( |
| 1982 const gfx::Point& point_in_screen) { | 1984 const gfx::Point& point_in_screen) { |
| 1983 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? | 1985 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? |
| 1984 attached_tabstrip_ : source_tabstrip_; | 1986 attached_tabstrip_ : source_tabstrip_; |
| 1985 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); | 1987 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); |
| 1986 | 1988 |
| 1987 gfx::Point offset = point_in_screen; | 1989 gfx::Point offset = point_in_screen; |
| 1988 views::View::ConvertPointFromScreen(toplevel_view, &offset); | 1990 views::View::ConvertPointFromScreen(toplevel_view, &offset); |
| 1989 return offset; | 1991 return offset; |
| 1990 } | 1992 } |
| OLD | NEW |