| 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 22 matching lines...) Expand all Loading... |
| 33 #include "ui/display/screen.h" | 33 #include "ui/display/screen.h" |
| 34 #include "ui/events/event_constants.h" | 34 #include "ui/events/event_constants.h" |
| 35 #include "ui/events/gestures/gesture_recognizer.h" | 35 #include "ui/events/gestures/gesture_recognizer.h" |
| 36 #include "ui/gfx/geometry/point_conversions.h" | 36 #include "ui/gfx/geometry/point_conversions.h" |
| 37 #include "ui/views/event_monitor.h" | 37 #include "ui/views/event_monitor.h" |
| 38 #include "ui/views/focus/view_storage.h" | 38 #include "ui/views/focus/view_storage.h" |
| 39 #include "ui/views/widget/root_view.h" | 39 #include "ui/views/widget/root_view.h" |
| 40 #include "ui/views/widget/widget.h" | 40 #include "ui/views/widget/widget.h" |
| 41 | 41 |
| 42 #if defined(USE_ASH) | 42 #if defined(USE_ASH) |
| 43 #include "ash/common/accelerators/accelerator_commands.h" | 43 #include "ash/common/accelerators/accelerator_commands.h" // nogncheck |
| 44 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 44 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" // nogncheck |
| 45 #include "ash/common/wm/window_state.h" | 45 #include "ash/common/wm/window_state.h" // nogncheck |
| 46 #include "ash/common/wm_shell.h" | 46 #include "ash/common/wm_shell.h" // nogncheck |
| 47 #include "ash/wm/window_state_aura.h" | 47 #include "ash/wm/window_state_aura.h" // nogncheck |
| 48 #include "ui/wm/core/coordinate_conversion.h" | 48 #include "ui/wm/core/coordinate_conversion.h" // nogncheck |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 #if defined(USE_AURA) | 51 #if defined(USE_AURA) |
| 52 #include "chrome/browser/ui/views/tabs/window_finder_mus.h" | 52 #include "chrome/browser/ui/views/tabs/window_finder_mus.h" // nogncheck |
| 53 #include "content/public/common/mojo_shell_connection.h" | 53 #include "content/public/common/mojo_shell_connection.h" // nogncheck |
| 54 #include "services/shell/runner/common/client_util.h" | 54 #include "services/shell/runner/common/client_util.h" // nogncheck |
| 55 #include "ui/aura/env.h" | 55 #include "ui/aura/env.h" // nogncheck |
| 56 #include "ui/aura/window.h" | 56 #include "ui/aura/window.h" // nogncheck |
| 57 #include "ui/wm/core/window_modality_controller.h" | 57 #include "ui/wm/core/window_modality_controller.h" // nogncheck |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 using base::UserMetricsAction; | 60 using base::UserMetricsAction; |
| 61 using content::OpenURLParams; | 61 using content::OpenURLParams; |
| 62 using content::WebContents; | 62 using content::WebContents; |
| 63 | 63 |
| 64 // If non-null there is a drag underway. | 64 // If non-null there is a drag underway. |
| 65 static TabDragController* instance_ = NULL; | 65 static TabDragController* instance_ = NULL; |
| 66 | 66 |
| 67 namespace { | 67 namespace { |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 // TODO(pkotwicz): Fix this properly (crbug.com/358482) | 1838 // TODO(pkotwicz): Fix this properly (crbug.com/358482) |
| 1839 for (auto* browser : *BrowserList::GetInstance()) { | 1839 for (auto* browser : *BrowserList::GetInstance()) { |
| 1840 if (browser->tab_strip_model()->empty()) | 1840 if (browser->tab_strip_model()->empty()) |
| 1841 exclude.insert(browser->window()->GetNativeWindow()); | 1841 exclude.insert(browser->window()->GetNativeWindow()); |
| 1842 } | 1842 } |
| 1843 #endif | 1843 #endif |
| 1844 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); | 1844 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); |
| 1845 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); | 1845 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); |
| 1846 return ref ? Liveness::ALIVE : Liveness::DELETED; | 1846 return ref ? Liveness::ALIVE : Liveness::DELETED; |
| 1847 } | 1847 } |
| OLD | NEW |