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..24e35bd06cdf5641a5ad1e5fbe3bd87d69e02fe2 |
--- /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 { |
+ OTHERS = 0, |
+ APP, |
+ 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; |
+ |
+// A metrics recorder that records stylus related metrics. |
+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_ |