Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1827)

Unified Diff: ash/wm/dock/docked_window_resizer.cc

Issue 45343003: UMA data collection for docked windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UMA data collection for docked windows (comments) Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f08002cb77c2b1743f9c4aa44f71cae0ea637e1c 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,
+ 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(
+ DOCKED_ACTION_NONE,
+ details_.source == aura::client::WINDOW_MOVE_SOURCE_MOUSE ?
+ DOCKED_ACTION_SOURCE_MOUSE : DOCKED_ACTION_SOURCE_TOUCH);
is_docked_ = false;
}
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698