summaryrefslogtreecommitdiffstats
path: root/content/browser/media/capture/window_activity_tracker.h
blob: d7b8d0f6ad15dfcf13461adf9ff1e337ba4ea487 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 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 CONTENT_BROWSER_MEDIA_CAPTURE_WINDOW_ACTIVITY_TRACKER_H_
#define CONTENT_BROWSER_MEDIA_CAPTURE_WINDOW_ACTIVITY_TRACKER_H_

#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"

namespace content {

// WindowActivityTracker is an interface that can be implememented to report
// whether the user is actively interacting with UI.
class CONTENT_EXPORT WindowActivityTracker {
 public:
  virtual ~WindowActivityTracker() {}

  // Returns true if UI interaction is active.
  virtual bool IsUiInteractionActive() const = 0;

  // Reports on every mouse movement activity on the window.
  virtual void RegisterMouseInteractionObserver(
      const base::Closure& observer) {}

  // Resets any previous UI activity tracked.
  virtual void Reset() = 0;

  // Returns a weak pointer.
  virtual base::WeakPtr<WindowActivityTracker> GetWeakPtr() = 0;
};

}  // namespace content

#endif  // CONTENT_BROWSER_MEDIA_CAPTURE_WINDOW_ACTIVITY_TRACKER_H_