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

Unified Diff: ash/shell.cc

Issue 2270173002: add stylus metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporate comments and rebase Created 4 years, 4 months 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
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 505e943e336ea8cda7d0bb667d8638340b9e2284..33ced2ef402428d468238c8a9cf622420793486a 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -128,6 +128,7 @@
#include "ash/system/chromeos/power/video_activity_notifier.h"
#include "ash/touch/touch_transformer_controller.h"
#include "ash/virtual_keyboard_controller.h"
+#include "ash/wm/stylus_metrics_recorder.h"
#include "base/bind_helpers.h"
#include "base/sys_info.h"
#include "chromeos/audio/audio_a11y_controller.h"
@@ -552,6 +553,9 @@ Shell::~Shell() {
RemovePostTargetHandler(toplevel_window_event_handler_.get());
RemovePreTargetHandler(system_gesture_filter_.get());
RemovePreTargetHandler(mouse_cursor_filter_.get());
+#if defined(OS_CHROMEOS)
+ RemovePreTargetHandler(stylus_metrics_recorder_.get());
+#endif
RemovePreTargetHandler(modality_filter_.get());
// TooltipController is deleted with the Shell so removing its references.
@@ -640,9 +644,7 @@ Shell::~Shell() {
#if defined(OS_CHROMEOS)
touch_transformer_controller_.reset();
-#endif // defined(OS_CHROMEOS)
-
-#if defined(OS_CHROMEOS)
+ stylus_metrics_recorder_.reset();
audio_a11y_controller_.reset();
#endif // defined(OS_CHROMEOS)
@@ -864,6 +866,14 @@ void Shell::Init(const ShellInitParams& init_params) {
mouse_cursor_filter_.reset(new MouseCursorEventFilter());
PrependPreTargetHandler(mouse_cursor_filter_.get());
+#if defined(OS_CHROMEOS)
+ // |stylus_metrics_recorder| records stylus metrics for certain events.
+ // It does not handle/consume any events, so prepend it as a pre-target hander
+ // before events are consumed elsewhere.
+ stylus_metrics_recorder_.reset(new StylusMetricsRecorder());
+ PrependPreTargetHandler(stylus_metrics_recorder_.get());
+#endif
+
// Create Controllers that may need root window.
// TODO(oshima): Move as many controllers before creating
// RootWindowController as possible.

Powered by Google App Engine
This is Rietveld 408576698