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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #endif | 89 #endif |
90 } | 90 } |
91 | 91 |
92 // Returns true if |tab_strip| browser window is docked. | 92 // Returns true if |tab_strip| browser window is docked. |
93 bool IsDockedOrSnapped(const TabStrip* tab_strip) { | 93 bool IsDockedOrSnapped(const TabStrip* tab_strip) { |
94 #if defined(USE_ASH) | 94 #if defined(USE_ASH) |
95 DCHECK(tab_strip); | 95 DCHECK(tab_strip); |
96 ash::wm::WindowState* window_state = | 96 ash::wm::WindowState* window_state = |
97 ash::wm::GetWindowState(tab_strip->GetWidget()->GetNativeWindow()); | 97 ash::wm::GetWindowState(tab_strip->GetWidget()->GetNativeWindow()); |
98 return window_state->IsDocked() || window_state->IsSnapped(); | 98 return window_state->IsDocked() || window_state->IsSnapped(); |
| 99 #else |
| 100 return false; |
99 #endif | 101 #endif |
100 return false; | |
101 } | 102 } |
102 | 103 |
103 // Returns true if |bounds| contains the y-coordinate |y|. The y-coordinate | 104 // Returns true if |bounds| contains the y-coordinate |y|. The y-coordinate |
104 // of |bounds| is adjusted by |vertical_adjustment|. | 105 // of |bounds| is adjusted by |vertical_adjustment|. |
105 bool DoesRectContainVerticalPointExpanded( | 106 bool DoesRectContainVerticalPointExpanded( |
106 const gfx::Rect& bounds, | 107 const gfx::Rect& bounds, |
107 int vertical_adjustment, | 108 int vertical_adjustment, |
108 int y) { | 109 int y) { |
109 int upper_threshold = bounds.bottom() + vertical_adjustment; | 110 int upper_threshold = bounds.bottom() + vertical_adjustment; |
110 int lower_threshold = bounds.y() - vertical_adjustment; | 111 int lower_threshold = bounds.y() - vertical_adjustment; |
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 aura::Window* dragged_window = | 1907 aura::Window* dragged_window = |
1907 attached_tabstrip_->GetWidget()->GetNativeView(); | 1908 attached_tabstrip_->GetWidget()->GetNativeView(); |
1908 if (dragged_window) | 1909 if (dragged_window) |
1909 exclude.insert(dragged_window); | 1910 exclude.insert(dragged_window); |
1910 } | 1911 } |
1911 return GetLocalProcessWindowAtPoint(host_desktop_type_, | 1912 return GetLocalProcessWindowAtPoint(host_desktop_type_, |
1912 screen_point, | 1913 screen_point, |
1913 exclude); | 1914 exclude); |
1914 | 1915 |
1915 } | 1916 } |
OLD | NEW |