diff options
author | pkotwicz <pkotwicz@chromium.org> | 2015-02-24 13:16:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-24 21:17:05 +0000 |
commit | deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc (patch) | |
tree | 8d245daf790fa78f98a033b774fb85fdc11e507c /ash | |
parent | c2c7d0fb617e4192ffc88e1634183354956bcc13 (diff) | |
download | chromium_src-deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc.zip chromium_src-deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc.tar.gz chromium_src-deb3f7248b8a7f7ed92b1cd4eaa7fb8df4645efc.tar.bz2 |
Pass location in screen coordinates to DragDropClient::StartDragAndDrop()
This CL:
- Avoids converting from screen coordinates in
WebContentsViewAura::StartDragging() and back to screen coordinates in
DragDropController::StartDragAndDrop()
- Passes the location in the correct coordinates to StartDragAndDrop() in
DragDownloadItem() in drag_download_item_views.cc
BUG=456619
TEST=Manual, see bug
Review URL: https://codereview.chromium.org/901563005
Cr-Commit-Position: refs/heads/master@{#317888}
Diffstat (limited to 'ash')
-rw-r--r-- | ash/drag_drop/drag_drop_controller.cc | 5 | ||||
-rw-r--r-- | ash/drag_drop/drag_drop_controller.h | 2 | ||||
-rw-r--r-- | ash/wm/overview/window_selector_controller.cc | 4 | ||||
-rw-r--r-- | ash/wm/overview/window_selector_item.cc | 14 | ||||
-rw-r--r-- | ash/wm/overview/window_selector_unittest.cc | 4 |
5 files changed, 14 insertions, 15 deletions
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index dedfffd..b57b24c 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -149,7 +149,7 @@ int DragDropController::StartDragAndDrop( const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) { if (IsDragDropInProgress()) @@ -194,8 +194,7 @@ int DragDropController::StartDragAndDrop( drag_image_scale = kTouchDragImageScale; drag_image_vertical_offset = kTouchDragImageVerticalOffset; } - gfx::Point start_location = root_location; - ::wm::ConvertPointToScreen(root_window, &start_location); + gfx::Point start_location = screen_location; drag_image_final_bounds_for_cancel_animation_ = gfx::Rect( start_location - provider->GetDragImageOffset(), provider->GetDragImage().size()); diff --git a/ash/drag_drop/drag_drop_controller.h b/ash/drag_drop/drag_drop_controller.h index a9007f2..35b1d9a 100644 --- a/ash/drag_drop/drag_drop_controller.h +++ b/ash/drag_drop/drag_drop_controller.h @@ -46,7 +46,7 @@ class ASH_EXPORT DragDropController int StartDragAndDrop(const ui::OSExchangeData& data, aura::Window* root_window, aura::Window* source_window, - const gfx::Point& root_location, + const gfx::Point& screen_location, int operation, ui::DragDropTypes::DragEventSource source) override; void DragUpdate(aura::Window* target, const ui::LocatedEvent& event) override; diff --git a/ash/wm/overview/window_selector_controller.cc b/ash/wm/overview/window_selector_controller.cc index bd0aaf1..6f21c8f 100644 --- a/ash/wm/overview/window_selector_controller.cc +++ b/ash/wm/overview/window_selector_controller.cc @@ -23,8 +23,8 @@ namespace ash { WindowSelectorController::WindowSelectorController() - : swipe_to_close_enabled_(base::CommandLine::ForCurrentProcess()-> - HasSwitch(switches::kAshEnableSwipeToCloseInOverviewMode)) { + : swipe_to_close_enabled_(base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAshEnableSwipeToCloseInOverviewMode)) { } WindowSelectorController::~WindowSelectorController() { diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc index 0ee5f7c..9fb6b8c 100644 --- a/ash/wm/overview/window_selector_item.cc +++ b/ash/wm/overview/window_selector_item.cc @@ -261,8 +261,9 @@ void WindowSelectorItem::ButtonPressed(views::Button* sender, } void WindowSelectorItem::OnGestureEvent(ui::GestureEvent* event) { - if (!Shell::GetInstance()->window_selector_controller()-> - swipe_to_close_enabled()) + if (!Shell::GetInstance() + ->window_selector_controller() + ->swipe_to_close_enabled()) return; int delta_x = 0; @@ -282,8 +283,7 @@ void WindowSelectorItem::OnGestureEvent(ui::GestureEvent* event) { } case ui::ET_GESTURE_SCROLL_UPDATE: { event->SetHandled(); - ScopedTransformOverviewWindow::ScopedAnimationSettings - animation_settings; + ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; transform_window_.BeginScopedAnimation( OverviewAnimationType::OVERVIEW_ANIMATION_SCROLL_SELECTOR_ITEM, &animation_settings); @@ -294,8 +294,8 @@ void WindowSelectorItem::OnGestureEvent(ui::GestureEvent* event) { transform_window_.get_overview_transform()); transform_window_.SetTransform(root_window(), new_transform); - const float opacity = CalculateOpacityFromScrollDistance(delta_x, - GetMinimumCloseDistance()); + const float opacity = CalculateOpacityFromScrollDistance( + delta_x, GetMinimumCloseDistance()); transform_window_.SetOpacity(opacity); break; } @@ -345,7 +345,7 @@ void WindowSelectorItem::ResetScrolledWindow() { &animation_settings); transform_window_.SetTransform(root_window(), - transform_window_.get_overview_transform()); + transform_window_.get_overview_transform()); transform_window_.SetOpacity(1.0); SetupFadeInAfterLayout(close_button_widget_.GetNativeWindow()); diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index b013a01..ec60952 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -1306,8 +1306,8 @@ TEST_F(WindowSelectorSwipeToCloseEnabledTest, ToggleOverview(); - gfx::Rect bounds = ToNearestRect(GetTransformedBoundsInRootWindow( - window.get())); + gfx::Rect bounds = + ToNearestRect(GetTransformedBoundsInRootWindow(window.get())); ui::test::EventGenerator event_generator(window->GetRootWindow()); const gfx::Point drag_start_point(bounds.CenterPoint()); |