Chromium Code Reviews| Index: ash/metrics/screen_event_task_switch_metric_recorder.h |
| diff --git a/ash/metrics/screen_event_task_switch_metric_recorder.h b/ash/metrics/screen_event_task_switch_metric_recorder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fffebc66505bf2fbffb9584ec9d5b0ac3a2a1871 |
| --- /dev/null |
| +++ b/ash/metrics/screen_event_task_switch_metric_recorder.h |
| @@ -0,0 +1,42 @@ |
| +// Copyright 2015 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 ASH_METRICS_SCREEN_EVENT_TASK_SWITCH_METRIC_RECORDER_H_ |
| +#define ASH_METRICS_SCREEN_EVENT_TASK_SWITCH_METRIC_RECORDER_H_ |
| + |
| +#include "ash/ash_export.h" |
| +#include "base/macros.h" |
| +#include "ui/wm/core/window_activation_pre_target_handler_observer.h" |
| +#include "ui/wm/public/activation_change_observer.h" |
| + |
| +namespace aura { |
| +class Window; |
| +} // namespace aura |
| + |
| +namespace ash { |
| + |
| +class UserMetricsRecorder; |
| + |
| +class ASH_EXPORT ScreenEventTaskSwitchMetricRecorder |
| + : public wm::WindowActivationPreTargetHandlerObserver { |
| + public: |
| + explicit ScreenEventTaskSwitchMetricRecorder( |
| + UserMetricsRecorder* user_metrics_recorder); |
| + ~ScreenEventTaskSwitchMetricRecorder() override; |
| + |
| + // wm::WindowActivationPreTargetHandlerObserver: |
| + void BeforeWindowActivatedByPreTargetHandler() override; |
| + void OnWindowActivatedByPreTargetHandler(aura::Window* gained_active, |
| + aura::Window* lost_active) override; |
| + |
| + private: |
| + UserMetricsRecorder* user_metrics_recorder_; |
| + aura::Window* active_window_before_activation_ = nullptr; |
|
tdanderson
2015/05/26 21:13:52
initialize to null in constructor
bruthig
2015/06/03 21:59:31
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScreenEventTaskSwitchMetricRecorder); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_METRICS_SCREEN_EVENT_TASK_SWITCH_METRIC_RECORDER_H_ |