Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_WINDOW_ACTIVITY_TRACKER_AURA_H_ | |
| 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_WINDOW_ACTIVITY_TRACKER_AURA_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/weak_ptr.h" | |
| 11 #include "content/browser/media/capture/window_activity_tracker.h" | |
| 12 #include "content/common/content_export.h" | |
| 13 #include "ui/aura/window.h" | |
| 14 #include "ui/events/event_handler.h" | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 // Tracks UI events and makes a decision on whether the user has been | |
| 19 // actively interacting with a specified window. | |
| 20 class CONTENT_EXPORT WindowActivityTrackerAura : public WindowActivityTracker, | |
| 21 public ui::EventHandler, | |
| 22 public aura::WindowObserver { | |
| 23 public: | |
| 24 explicit WindowActivityTrackerAura(aura::Window* window); | |
| 25 ~WindowActivityTrackerAura() final; | |
| 26 | |
| 27 // WindowActivityTracker overrides. | |
| 28 bool IsUiInteractionActive() const final; | |
| 29 void Reset() final; | |
| 30 base::WeakPtr<WindowActivityTracker> GetWeakPtr() final; | |
| 31 | |
| 32 private: | |
| 33 // ui::EventHandler overrides. | |
| 34 void OnEvent(ui::Event* event) final; | |
| 35 | |
| 36 // aura::WindowObserver overrides. | |
| 37 void OnWindowDestroying(aura::Window* window) final; | |
| 38 | |
| 39 aura::Window* window_; | |
| 40 | |
| 41 // The last time a UI event was detected. | |
| 42 base::TimeTicks last_time_ui_event_detected_; | |
| 43 // The number of UI events detected so far. In case of continuous events | |
|
miu
2015/12/08 00:16:16
nit: add newline above this line
Irfan
2015/12/08 01:30:18
Done.
| |
| 44 // such as mouse movement, a single continuous movement is treated | |
| 45 // as one event. | |
| 46 int ui_events_count_; | |
| 47 | |
| 48 base::WeakPtrFactory<WindowActivityTrackerAura> weak_factory_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(WindowActivityTrackerAura); | |
| 51 }; | |
| 52 | |
| 53 } // namespace content | |
| 54 | |
| 55 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_WINDOW_ACTIVITY_TRACKER_AURA_H_ | |
| OLD | NEW |