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

Unified Diff: chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h

Issue 2331093002: UMA stats for stylus usage (Closed)
Patch Set: Incorporate comments from xiyuan@ and mpearson@ Created 4 years, 3 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: chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h
diff --git a/chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h b/chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h
new file mode 100644
index 0000000000000000000000000000000000000000..d5960b6bab575b4a4728000e3548baa562af3791
--- /dev/null
+++ b/chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ASH_METRICS_STYLUS_METRICS_RECORDER_CHROMEOS_H_
+#define CHROME_BROWSER_UI_ASH_METRICS_STYLUS_METRICS_RECORDER_CHROMEOS_H_
+
+#include "base/macros.h"
+#include "ui/aura/window.h"
+#include "ui/views/pointer_watcher.h"
+
+namespace gfx {
+class Point;
+}
+
+namespace ui {
+class PointerEvent;
+}
+
+namespace chromeos {
+
+enum class StylusWindowType {
+ WINDOW_TYPE_OTHERS = 0,
sky 2016/09/16 23:20:16 StylusWindowType::WINDOW_TYPE is a bit redundant,
xiaoyinh(OOO Sep 11-29) 2016/09/19 21:19:53 Done.
+ WINDOW_TYPE_APP,
+ WINDOW_TYPE_BROWSER_WINDOW,
+};
+
+// A property key to store the type of window that will be used to record stylus
+// metrics.
+extern const aura::WindowProperty<StylusWindowType>* const
+ kStylusWindowTypeBucket;
+
+// An metrics recorder that record stylus related metrics.
sky 2016/09/16 23:20:16 An->A record->records
xiaoyinh(OOO Sep 11-29) 2016/09/19 21:19:53 Thanks. Changed.
+class StylusMetricsRecorder : public views::PointerWatcher {
+ public:
+ StylusMetricsRecorder();
+ ~StylusMetricsRecorder() override;
+
+ private:
+ // views::PointerWatcher:
+ void OnPointerEventObserved(const ui::PointerEvent& event,
+ const gfx::Point& location_in_screen,
+ views::Widget* target) override;
+
+ DISALLOW_COPY_AND_ASSIGN(StylusMetricsRecorder);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_ASH_METRICS_STYLUS_METRICS_RECORDER_CHROMEOS_H_

Powered by Google App Engine
This is Rietveld 408576698