summaryrefslogtreecommitdiffstats
path: root/ash/display/projecting_observer_chromeos.h
blob: 3320ae8d4acef4c94c8a3b5c8426043beb652598 (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
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2014 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_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_
#define ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_

#include "ash/ash_export.h"
#include "ui/display/chromeos/output_configurator.h"

namespace ash {

namespace internal {

class ASH_EXPORT ProjectingObserver : public ui::OutputConfigurator::Observer {
 public:
  ProjectingObserver();
  virtual ~ProjectingObserver();

  // Called when a casting session is started or stopped.
  void OnCastingSessionStartedOrStopped(bool started);

  // OutputConfigurator::Observer implementation:
  virtual void OnDisplayModeChanged(
      const ui::OutputConfigurator::DisplayStateList& outputs) OVERRIDE;

 private:
  // Sends the current projecting state to power manager.
  void SetIsProjecting();

  // True if at least one output is internal. This value is updated when
  // |OnDisplayModeChanged| is called.
  bool has_internal_output_;

  // Keeps track of the number of connected outputs.
  int output_count_;

  // Number of outstanding casting sessions.
  int casting_session_count_;

  DISALLOW_COPY_AND_ASSIGN(ProjectingObserver);
};

}  // namespace internal

}  // namespace ash

#endif  // ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_