| 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/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "ui/gfx/animation/animation_delegate.h" | 43 #include "ui/gfx/animation/animation_delegate.h" |
| 44 #include "ui/gfx/animation/slide_animation.h" | 44 #include "ui/gfx/animation/slide_animation.h" |
| 45 #include "ui/gfx/canvas.h" | 45 #include "ui/gfx/canvas.h" |
| 46 #include "ui/gfx/image/image_skia.h" | 46 #include "ui/gfx/image/image_skia.h" |
| 47 #include "ui/gfx/screen.h" | 47 #include "ui/gfx/screen.h" |
| 48 #include "ui/views/focus/view_storage.h" | 48 #include "ui/views/focus/view_storage.h" |
| 49 #include "ui/views/widget/root_view.h" | 49 #include "ui/views/widget/root_view.h" |
| 50 #include "ui/views/widget/widget.h" | 50 #include "ui/views/widget/widget.h" |
| 51 | 51 |
| 52 #if defined(USE_ASH) | 52 #if defined(USE_ASH) |
| 53 #include "ash/shell.h" | 53 #include "ash/accelerators/accelerator_commands.h" |
| 54 #include "ash/shell_delegate.h" | |
| 55 #include "ash/wm/coordinate_conversion.h" | 54 #include "ash/wm/coordinate_conversion.h" |
| 56 #include "ash/wm/window_state.h" | 55 #include "ash/wm/window_state.h" |
| 57 #include "ui/aura/env.h" | 56 #include "ui/aura/env.h" |
| 58 #include "ui/aura/root_window.h" | 57 #include "ui/aura/root_window.h" |
| 59 #include "ui/events/gestures/gesture_recognizer.h" | 58 #include "ui/events/gestures/gesture_recognizer.h" |
| 60 #endif | 59 #endif |
| 61 | 60 |
| 62 #if defined(OS_WIN) && defined(USE_AURA) | 61 #if defined(OS_WIN) && defined(USE_AURA) |
| 63 #include "ui/aura/window.h" | 62 #include "ui/aura/window.h" |
| 64 #include "ui/events/gestures/gesture_recognizer.h" | 63 #include "ui/events/gestures/gesture_recognizer.h" |
| (...skipping 1809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1874 if (attached_tabstrip_) { | 1873 if (attached_tabstrip_) { |
| 1875 if (is_dragging_new_browser_) { | 1874 if (is_dragging_new_browser_) { |
| 1876 // If source window was maximized - maximize the new window as well. | 1875 // If source window was maximized - maximize the new window as well. |
| 1877 if (was_source_maximized_) | 1876 if (was_source_maximized_) |
| 1878 attached_tabstrip_->GetWidget()->Maximize(); | 1877 attached_tabstrip_->GetWidget()->Maximize(); |
| 1879 #if defined(USE_ASH) | 1878 #if defined(USE_ASH) |
| 1880 if (was_source_fullscreen_ && | 1879 if (was_source_fullscreen_ && |
| 1881 host_desktop_type_ == chrome::HOST_DESKTOP_TYPE_ASH) { | 1880 host_desktop_type_ == chrome::HOST_DESKTOP_TYPE_ASH) { |
| 1882 // In fullscreen mode it is only possible to get here if the source | 1881 // In fullscreen mode it is only possible to get here if the source |
| 1883 // was in "immersive fullscreen" mode, so toggle it back on. | 1882 // was in "immersive fullscreen" mode, so toggle it back on. |
| 1884 ash::Shell::GetInstance()->delegate()->ToggleFullscreen(); | 1883 ash::accelerators::ToggleFullscreen(); |
| 1885 } | 1884 } |
| 1886 #endif | 1885 #endif |
| 1887 } | 1886 } |
| 1888 attached_tabstrip_->StoppedDraggingTabs( | 1887 attached_tabstrip_->StoppedDraggingTabs( |
| 1889 GetTabsMatchingDraggedContents(attached_tabstrip_), | 1888 GetTabsMatchingDraggedContents(attached_tabstrip_), |
| 1890 initial_tab_positions_, | 1889 initial_tab_positions_, |
| 1891 move_behavior_ == MOVE_VISIBILE_TABS, | 1890 move_behavior_ == MOVE_VISIBILE_TABS, |
| 1892 true); | 1891 true); |
| 1893 } else { | 1892 } else { |
| 1894 if (dock_info_.type() != DockInfo::NONE) { | 1893 if (dock_info_.type() != DockInfo::NONE) { |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2258 gfx::Vector2d TabDragController::GetWindowOffset( | 2257 gfx::Vector2d TabDragController::GetWindowOffset( |
| 2259 const gfx::Point& point_in_screen) { | 2258 const gfx::Point& point_in_screen) { |
| 2260 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? | 2259 TabStrip* owning_tabstrip = (attached_tabstrip_ && detach_into_browser_) ? |
| 2261 attached_tabstrip_ : source_tabstrip_; | 2260 attached_tabstrip_ : source_tabstrip_; |
| 2262 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); | 2261 views::View* toplevel_view = owning_tabstrip->GetWidget()->GetContentsView(); |
| 2263 | 2262 |
| 2264 gfx::Point point = point_in_screen; | 2263 gfx::Point point = point_in_screen; |
| 2265 views::View::ConvertPointFromScreen(toplevel_view, &point); | 2264 views::View::ConvertPointFromScreen(toplevel_view, &point); |
| 2266 return point.OffsetFromOrigin(); | 2265 return point.OffsetFromOrigin(); |
| 2267 } | 2266 } |
| OLD | NEW |