Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc |
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
index 2d2b5506a210d74b40e95851e6779f9b8f7c1308..7c737fd3426c3c3d424b5b89a570ab90cc80fd34 100644 |
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc |
@@ -38,14 +38,17 @@ |
#include "ui/views/focus/view_storage.h" |
#include "ui/views/widget/root_view.h" |
#include "ui/views/widget/widget.h" |
-#include "ui/wm/core/coordinate_conversion.h" |
-#include "ui/wm/core/window_modality_controller.h" |
#if defined(USE_ASH) |
#include "ash/accelerators/accelerator_commands.h" |
#include "ash/shell.h" |
#include "ash/wm/maximize_mode/maximize_mode_controller.h" |
#include "ash/wm/window_state.h" |
+#include "ui/wm/core/coordinate_conversion.h" |
+#endif |
+ |
+#if defined(USE_AURA) |
+#include "ui/wm/core/window_modality_controller.h" |
#endif |
using base::UserMetricsAction; |
@@ -94,6 +97,17 @@ bool IsDockedOrSnapped(const TabStrip* tab_strip) { |
} |
#endif |
+#if defined(USE_AURA) |
+gfx::NativeWindow GetModalTransient(gfx::NativeWindow window) { |
+ return wm::GetModalTransient(window); |
+} |
+#else |
+gfx::NativeWindow GetModalTransient(gfx::NativeWindow window) { |
+ NOTIMPLEMENTED(); |
+ return NULL; |
+} |
+#endif |
+ |
// Returns true if |bounds| contains the y-coordinate |y|. The y-coordinate |
// of |bounds| is adjusted by |vertical_adjustment|. |
bool DoesRectContainVerticalPointExpanded( |
@@ -123,7 +137,7 @@ class WindowPositionManagedUpdater : public views::WidgetObserver { |
public: |
virtual void OnWidgetVisibilityChanged(views::Widget* widget, |
bool visible) override { |
- SetWindowPositionManaged(widget->GetNativeView(), false); |
+ SetWindowPositionManaged(widget->GetNativeWindow(), false); |
} |
}; |
@@ -217,7 +231,7 @@ TabDragController::~TabDragController() { |
if (move_loop_widget_) { |
move_loop_widget_->RemoveObserver(this); |
- SetWindowPositionManaged(move_loop_widget_->GetNativeView(), true); |
+ SetWindowPositionManaged(move_loop_widget_->GetNativeWindow(), true); |
} |
if (source_tabstrip_) |
@@ -608,7 +622,7 @@ TabDragController::DragBrowserToNewTabStrip( |
// The window is going away. Since the drag is still on going we don't want |
// that to effect the position of any windows. |
- SetWindowPositionManaged(browser_widget->GetNativeView(), false); |
+ SetWindowPositionManaged(browser_widget->GetNativeWindow(), false); |
#if !defined(OS_LINUX) || defined(OS_CHROMEOS) |
// EndMoveLoop is going to snap the window back to its original location. |
@@ -826,7 +840,7 @@ TabStrip* TabDragController::GetTargetTabStripForPoint( |
GetLocalProcessWindow(point_in_screen, is_dragging_window_); |
// Do not allow dragging into a window with a modal dialog, it causes a weird |
// behavior. See crbug.com/336691 |
- if (!wm::GetModalTransient(local_window)) { |
+ if (!GetModalTransient(local_window)) { |
TabStrip* tab_strip = GetTabStripForWindow(local_window); |
if (tab_strip && DoesTabStripContain(tab_strip, point_in_screen)) |
return tab_strip; |
@@ -1337,7 +1351,7 @@ void TabDragController::EndDragImpl(EndDragType type) { |
waiting_for_run_loop_to_exit_ = true; |
if (type == NORMAL || (type == TAB_DESTROYED && drag_data_.size() > 1)) { |
- SetWindowPositionManaged(GetAttachedBrowserWidget()->GetNativeView(), |
+ SetWindowPositionManaged(GetAttachedBrowserWidget()->GetNativeWindow(), |
true); |
} |
@@ -1553,7 +1567,7 @@ gfx::Rect TabDragController::GetViewScreenBounds( |
void TabDragController::BringWindowUnderPointToFront( |
const gfx::Point& point_in_screen) { |
- aura::Window* window = GetLocalProcessWindow(point_in_screen, true); |
+ gfx::NativeWindow window = GetLocalProcessWindow(point_in_screen, true); |
// Only bring browser windows to front - only windows with a TabStrip can |
// be tab drag targets. |
@@ -1561,11 +1575,12 @@ void TabDragController::BringWindowUnderPointToFront( |
return; |
if (window) { |
- views::Widget* widget_window = views::Widget::GetWidgetForNativeView( |
+ views::Widget* widget_window = views::Widget::GetWidgetForNativeWindow( |
window); |
if (!widget_window) |
return; |
+#if defined(USE_ASH) |
if (host_desktop_type_ == chrome::HOST_DESKTOP_TYPE_ASH) { |
// TODO(varkha): The code below ensures that the phantom drag widget |
// is shown on top of browser windows. The code should be moved to ash/ |
@@ -1597,6 +1612,9 @@ void TabDragController::BringWindowUnderPointToFront( |
} else { |
widget_window->StackAtTop(); |
} |
+#else |
+ widget_window->StackAtTop(); |
+#endif |
// The previous call made the window appear on top of the dragged window, |
// move the dragged window to the front. |
@@ -1733,6 +1751,7 @@ Browser* TabDragController::CreateBrowserForDrag( |
} |
gfx::Point TabDragController::GetCursorScreenPoint() { |
+#if defined(USE_ASH) |
if (host_desktop_type_ == chrome::HOST_DESKTOP_TYPE_ASH && |
event_source_ == EVENT_SOURCE_TOUCH && |
aura::Env::GetInstance()->is_touch_down()) { |
@@ -1749,6 +1768,7 @@ gfx::Point TabDragController::GetCursorScreenPoint() { |
wm::ConvertPointToScreen(widget_window->GetRootWindow(), &touch_point); |
return touch_point; |
} |
+#endif |
return screen_->GetCursorScreenPoint(); |
} |
@@ -1767,10 +1787,10 @@ gfx::Vector2d TabDragController::GetWindowOffset( |
gfx::NativeWindow TabDragController::GetLocalProcessWindow( |
const gfx::Point& screen_point, |
bool exclude_dragged_view) { |
- std::set<aura::Window*> exclude; |
+ std::set<gfx::NativeWindow> exclude; |
if (exclude_dragged_view) { |
- aura::Window* dragged_window = |
- attached_tabstrip_->GetWidget()->GetNativeView(); |
+ gfx::NativeWindow dragged_window = |
+ attached_tabstrip_->GetWidget()->GetNativeWindow(); |
if (dragged_window) |
exclude.insert(dragged_window); |
} |