Chromium Code Reviews| Index: chrome/browser/ui/ash/metrics/stylus_metrics_recorder.h |
| diff --git a/chrome/browser/ui/ash/metrics/stylus_metrics_recorder.h b/chrome/browser/ui/ash/metrics/stylus_metrics_recorder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..97490ddb53da9d6284913c9a72cecb404e9c21aa |
| --- /dev/null |
| +++ b/chrome/browser/ui/ash/metrics/stylus_metrics_recorder.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_H_ |
| +#define CHROME_BROWSER_UI_ASH_METRICS_STYLUS_METRICS_RECORDER_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 { |
|
xiyuan
2016/09/16 20:07:54
This file is in the ash section in browser/ui/BUIL
xiaoyinh(OOO Sep 11-29)
2016/09/16 22:34:25
Renamed as stylus_metrics_recorder_chromeos.h/cc.
|
| + |
| +enum class StylusWindowType { |
| + WINDOW_TYPE_OTHERS = 0, |
| + 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. |
| +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_H_ |