| 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 26 matching lines...) Expand all Loading... |
| 37 #include "ui/gfx/geometry/point_conversions.h" | 37 #include "ui/gfx/geometry/point_conversions.h" |
| 38 #include "ui/views/event_monitor.h" | 38 #include "ui/views/event_monitor.h" |
| 39 #include "ui/views/focus/view_storage.h" | 39 #include "ui/views/focus/view_storage.h" |
| 40 #include "ui/views/widget/root_view.h" | 40 #include "ui/views/widget/root_view.h" |
| 41 #include "ui/views/widget/widget.h" | 41 #include "ui/views/widget/widget.h" |
| 42 | 42 |
| 43 #if defined(USE_ASH) | 43 #if defined(USE_ASH) |
| 44 #include "ash/common/accelerators/accelerator_commands.h" // nogncheck | 44 #include "ash/common/accelerators/accelerator_commands.h" // nogncheck |
| 45 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" // nogncheck | 45 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" // nogncheck |
| 46 #include "ash/common/wm/window_state.h" // nogncheck | 46 #include "ash/common/wm/window_state.h" // nogncheck |
| 47 #include "ash/common/wm_shell.h" // nogncheck | 47 #include "ash/shell.h" // nogncheck |
| 48 #include "ash/wm/window_state_aura.h" // nogncheck | 48 #include "ash/wm/window_state_aura.h" // nogncheck |
| 49 #include "ui/wm/core/coordinate_conversion.h" // nogncheck | 49 #include "ui/wm/core/coordinate_conversion.h" // nogncheck |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 #if defined(USE_AURA) | 52 #if defined(USE_AURA) |
| 53 #include "ui/aura/env.h" // nogncheck | 53 #include "ui/aura/env.h" // nogncheck |
| 54 #include "ui/aura/window.h" // nogncheck | 54 #include "ui/aura/window.h" // nogncheck |
| 55 #include "ui/wm/core/window_modality_controller.h" // nogncheck | 55 #include "ui/wm/core/window_modality_controller.h" // nogncheck |
| 56 #endif | 56 #endif |
| 57 | 57 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 InitWindowCreatePoint(); | 285 InitWindowCreatePoint(); |
| 286 initial_selection_model_.Copy(initial_selection_model); | 286 initial_selection_model_.Copy(initial_selection_model); |
| 287 | 287 |
| 288 // Gestures don't automatically do a capture. We don't allow multiple drags at | 288 // Gestures don't automatically do a capture. We don't allow multiple drags at |
| 289 // the same time, so we explicitly capture. | 289 // the same time, so we explicitly capture. |
| 290 if (event_source == EVENT_SOURCE_TOUCH) | 290 if (event_source == EVENT_SOURCE_TOUCH) |
| 291 source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_); | 291 source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_); |
| 292 | 292 |
| 293 #if defined(USE_ASH) | 293 #if defined(USE_ASH) |
| 294 if (ash::WmShell::HasInstance() && | 294 if (ash::Shell::HasInstance() && ash::Shell::Get() |
| 295 ash::WmShell::Get() | 295 ->maximize_mode_controller() |
| 296 ->maximize_mode_controller() | 296 ->IsMaximizeModeWindowManagerEnabled()) { |
| 297 ->IsMaximizeModeWindowManagerEnabled()) { | |
| 298 detach_behavior_ = NOT_DETACHABLE; | 297 detach_behavior_ = NOT_DETACHABLE; |
| 299 } | 298 } |
| 300 #endif | 299 #endif |
| 301 } | 300 } |
| 302 | 301 |
| 303 // static | 302 // static |
| 304 bool TabDragController::IsAttachedTo(const TabStrip* tab_strip) { | 303 bool TabDragController::IsAttachedTo(const TabStrip* tab_strip) { |
| 305 return (instance_ && instance_->active() && | 304 return (instance_ && instance_->active() && |
| 306 instance_->attached_tabstrip() == tab_strip); | 305 instance_->attached_tabstrip() == tab_strip); |
| 307 } | 306 } |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1795 // TODO(pkotwicz): Fix this properly (crbug.com/358482) | 1794 // TODO(pkotwicz): Fix this properly (crbug.com/358482) |
| 1796 for (auto* browser : *BrowserList::GetInstance()) { | 1795 for (auto* browser : *BrowserList::GetInstance()) { |
| 1797 if (browser->tab_strip_model()->empty()) | 1796 if (browser->tab_strip_model()->empty()) |
| 1798 exclude.insert(browser->window()->GetNativeWindow()); | 1797 exclude.insert(browser->window()->GetNativeWindow()); |
| 1799 } | 1798 } |
| 1800 #endif | 1799 #endif |
| 1801 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); | 1800 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); |
| 1802 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); | 1801 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); |
| 1803 return ref ? Liveness::ALIVE : Liveness::DELETED; | 1802 return ref ? Liveness::ALIVE : Liveness::DELETED; |
| 1804 } | 1803 } |
| OLD | NEW |