Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / ash / display / projecting_observer_chromeos.h
blob0c6b4d149e4936c0b15763689421436e305869d5
1 // Copyright 2014 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.
5 #ifndef ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_
6 #define ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_
8 #include "ash/ash_export.h"
9 #include "ash/shell_observer.h"
10 #include "ui/display/chromeos/display_configurator.h"
12 namespace chromeos {
13 class PowerManagerClient;
16 namespace ash {
18 class ASH_EXPORT ProjectingObserver : public ui::DisplayConfigurator::Observer,
19 public ShellObserver {
20 public:
21 // |power_manager_client| must outlive this object.
22 explicit ProjectingObserver(
23 chromeos::PowerManagerClient* power_manager_client);
24 ~ProjectingObserver() override;
26 // DisplayConfigurator::Observer implementation:
27 void OnDisplayModeChanged(
28 const ui::DisplayConfigurator::DisplayStateList& outputs) override;
30 // ash::ShellObserver implementation:
31 void OnCastingSessionStartedOrStopped(bool started) override;
33 private:
34 // Sends the current projecting state to power manager.
35 void SetIsProjecting();
37 // True if at least one output is internal. This value is updated when
38 // |OnDisplayModeChanged| is called.
39 bool has_internal_output_;
41 // Keeps track of the number of connected outputs.
42 int output_count_;
44 // Number of outstanding casting sessions.
45 int casting_session_count_;
47 // Weak pointer to the DBusClient PowerManagerClient;
48 chromeos::PowerManagerClient* power_manager_client_;
50 DISALLOW_COPY_AND_ASSIGN(ProjectingObserver);
53 } // namespace ash
55 #endif // ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_