Chromium Code Reviews| Index: ash/wm/dock/docked_window_resizer.cc |
| diff --git a/ash/wm/dock/docked_window_resizer.cc b/ash/wm/dock/docked_window_resizer.cc |
| index 28d043848b298463ceae29a7f7289faed357b3df..e256ee368d7a347b5ec2b1fe2a9661b580491e4e 100644 |
| --- a/ash/wm/dock/docked_window_resizer.cc |
| +++ b/ash/wm/dock/docked_window_resizer.cc |
| @@ -106,7 +106,10 @@ void DockedWindowResizer::Drag(const gfx::Point& location, int event_flags) { |
| if (is_docked_ && dock_layout_->is_dragged_window_docked()) |
| dock_layout_->UndockDraggedWindow(); |
| if (dock_layout_ != initial_dock_layout_) |
| - dock_layout_->FinishDragging(); |
| + dock_layout_->FinishDragging( |
| + DOCKED_ACTION_NONE, |
| + details_.source == aura::client::WINDOW_MOVE_SOURCE_MOUSE ? |
| + DOCKED_ACTION_SOURCE_MOUSE : DOCKED_ACTION_SOURCE_TOUCH); |
| is_docked_ = false; |
| dock_layout_ = new_dock_layout; |
| // The window's initial layout manager already knows that the drag is |
| @@ -262,6 +265,7 @@ void DockedWindowResizer::FinishedDragging() { |
| window_state->ClearRestoreBounds(); |
| // Check if the window needs to be docked or returned to workspace. |
| + DockedAction action = DOCKED_ACTION_NONE; |
| aura::Window* dock_container = Shell::GetContainer( |
| window->GetRootWindow(), |
| kShellWindowId_DockedContainer); |
| @@ -269,6 +273,7 @@ void DockedWindowResizer::FinishedDragging() { |
| is_docked_ != (window->parent() == dock_container)) { |
| if (is_docked_) { |
| wm::ReparentChildWithTransientChildren(dock_container, window); |
| + action = DOCKED_ACTION_DOCK; |
| } else if (window->parent()->id() == kShellWindowId_DockedContainer) { |
| // Reparent the window back to workspace. |
| // We need to be careful to give ParentWindowWithContext a location in |
| @@ -282,15 +287,32 @@ void DockedWindowResizer::FinishedDragging() { |
| aura::client::ParentWindowWithContext(window, window, near_last_location); |
| if (window->parent() != previous_parent) |
| wm::ReparentTransientChildrenOfChild(window->parent(), window); |
| + action = was_docked_ ? DOCKED_ACTION_UNDOCK : DOCKED_ACTION_NONE; |
| } |
| + } else { |
| + // Docked state was not changed but still need to record a UMA action. |
| + if (is_resized && is_docked_ && was_docked_) |
| + action = DOCKED_ACTION_RESIZE; |
| + else if (is_docked_ && was_docked_) |
| + action = DOCKED_ACTION_REORDER; |
| + else if (is_docked_ && !was_docked_) |
| + action = DOCKED_ACTION_DOCK; |
| + else |
| + action = DOCKED_ACTION_NONE; |
| } |
| - dock_layout_->FinishDragging(); |
| + dock_layout_->FinishDragging( |
| + action, |
|
flackr
2013/10/31 03:01:51
So this will still be called with every window dra
varkha
2013/10/31 13:33:03
FinishDragging is called on every drag, however DO
flackr
2013/10/31 22:17:58
Ah okay, I missed that. Sounds good.
|
| + details_.source == aura::client::WINDOW_MOVE_SOURCE_MOUSE ? |
| + DOCKED_ACTION_SOURCE_MOUSE : DOCKED_ACTION_SOURCE_TOUCH); |
| // If we started the drag in one root window and moved into another root |
| // but then canceled the drag we may need to inform the original layout |
| // manager that the drag is finished. |
| if (initial_dock_layout_ != dock_layout_) |
| - initial_dock_layout_->FinishDragging(); |
| + initial_dock_layout_->FinishDragging( |
| + action, |
|
flackr
2013/10/31 03:01:51
This would double count the action, perhaps there
varkha
2013/10/31 13:33:03
Perhaps I need a separate set of metrics or some w
flackr
2013/10/31 22:17:58
Or just pass DOCKED_ACTION_NONE since this isn't c
varkha
2013/11/01 03:27:42
Done.
|
| + details_.source == aura::client::WINDOW_MOVE_SOURCE_MOUSE ? |
| + DOCKED_ACTION_SOURCE_MOUSE : DOCKED_ACTION_SOURCE_TOUCH); |
| is_docked_ = false; |
| } |