Chromium Code Reviews| Index: ash/wm/dock/docked_window_layout_manager.h |
| diff --git a/ash/wm/dock/docked_window_layout_manager.h b/ash/wm/dock/docked_window_layout_manager.h |
| index f380f77d5afca0a0ec1b7fa1ccc1e417eb10661d..4fda55dffc6ea7cc53d165229e0f7433847f069f 100644 |
| --- a/ash/wm/dock/docked_window_layout_manager.h |
| +++ b/ash/wm/dock/docked_window_layout_manager.h |
| @@ -17,6 +17,7 @@ |
| #include "base/gtest_prod_util.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/observer_list.h" |
| +#include "base/time/time.h" |
| #include "ui/aura/client/activation_change_observer.h" |
| #include "ui/aura/layout_manager.h" |
| #include "ui/aura/window.h" |
| @@ -45,6 +46,31 @@ class DockedWindowResizerTest; |
| class ShelfLayoutManager; |
| class WorkspaceController; |
| +// User action recorded for use in UMA histograms. |
| +enum DockedAction { |
| + DOCKED_ACTION_NONE, // Dragged but not changing the docked state. |
|
flackr
2013/10/31 03:01:51
Seems to me that this is a regular drag outside of
varkha
2013/10/31 13:33:03
I meant "not moving or changing state of docked wi
flackr
2013/10/31 22:17:58
The collection is fine as is assuming that a drag
varkha
2013/11/01 03:27:42
Done.
|
| + DOCKED_ACTION_DOCK, // Dragged and docked a window. |
| + DOCKED_ACTION_UNDOCK, // Dragged and undocked a window. |
| + DOCKED_ACTION_RESIZE, // Resized a docked window. |
| + DOCKED_ACTION_REORDER, // Reordered docked windows. |
| + DOCKED_ACTION_EVICT, // A docked window could not stay docked. |
| + DOCKED_ACTION_MAXIMIZE, // Maximized a docked window. |
| + DOCKED_ACTION_MINIMIZE, // Minimized a docked window. |
| + DOCKED_ACTION_RESTORE, // Restored a docked window that was minimized. |
| + DOCKED_ACTION_CLOSE, // Closed a window while it was docked. |
| + DOCKED_ACTION_COUNT, // Maximum value of this enum for histograms use. |
| +}; |
| + |
| +// Event source for the docking user action (when known). |
| +enum DockedActionSource { |
| + DOCKED_ACTION_SOURCE_UNKNOWN, |
| + DOCKED_ACTION_SOURCE_MOUSE, |
| + DOCKED_ACTION_SOURCE_TOUCH, |
| + |
| + // Maximum value of this enum for histograms use. |
| + DOCKED_ACTION_SOURCE_COUNT, |
| +}; |
| + |
| struct WindowWithHeight { |
| explicit WindowWithHeight(aura::Window* window) : |
| window_(window), |
| @@ -104,7 +130,8 @@ class ASH_EXPORT DockedWindowLayoutManager |
| // Called by a DockedWindowResizer when a window is no longer being dragged. |
| // Stops observing the window unless it is a child. |
| - void FinishDragging(); |
| + // Records |action| by |source| in UMA. |
| + void FinishDragging(DockedAction action, DockedActionSource source); |
| ash::Launcher* launcher() { return launcher_; } |
| void SetLauncher(ash::Launcher* launcher); |
| @@ -180,6 +207,12 @@ class ASH_EXPORT DockedWindowLayoutManager |
| void MinimizeDockedWindow(wm::WindowState* window_state); |
| void RestoreDockedWindow(wm::WindowState* window_state); |
| + // Record user-initiated |action| by |source| in UMA metrics. |
| + void RecordUmaAction(DockedAction action, DockedActionSource source); |
| + |
| + // Updates |docked_width_| and UMA histograms. |
| + void UpdateDockedWidth(int width); |
| + |
| // Updates docked layout state when a window gets inside the dock. |
| void OnDraggedWindowDocked(aura::Window* window); |
| @@ -267,6 +300,10 @@ class ASH_EXPORT DockedWindowLayoutManager |
| // are currently focused. |
| aura::Window* last_active_window_; |
| + // Timestamp of the last user-initiated action that changed docked state. |
| + // Used in UMA metrics. |
| + base::Time last_action_time_; |
| + |
| // Widget used to paint a background for the docked area. |
| scoped_ptr<views::Widget> background_widget_; |