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

Unified Diff: ash/wm/dock/docked_window_layout_manager.h

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 | « no previous file | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..737a7edaf0a5e2834406e5820a94814a240f5d54 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, // Regular drag of undocked window. Not recorded.
+ 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, // Possibly 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_;
« no previous file with comments | « no previous file | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698