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 "ui/display/chromeos/display_configurator.h"
12 class PowerManagerClient
;
17 class ASH_EXPORT ProjectingObserver
: public ui::DisplayConfigurator::Observer
{
19 // |power_manager_client| must outlive this object.
20 explicit ProjectingObserver(
21 chromeos::PowerManagerClient
* power_manager_client
);
22 virtual ~ProjectingObserver();
24 // Called when a casting session is started or stopped.
25 void OnCastingSessionStartedOrStopped(bool started
);
27 // DisplayConfigurator::Observer implementation:
28 virtual void OnDisplayModeChanged(
29 const ui::DisplayConfigurator::DisplayStateList
& outputs
) override
;
32 // Sends the current projecting state to power manager.
33 void SetIsProjecting();
35 // True if at least one output is internal. This value is updated when
36 // |OnDisplayModeChanged| is called.
37 bool has_internal_output_
;
39 // Keeps track of the number of connected outputs.
42 // Number of outstanding casting sessions.
43 int casting_session_count_
;
45 // Weak pointer to the DBusClient PowerManagerClient;
46 chromeos::PowerManagerClient
* power_manager_client_
;
48 DISALLOW_COPY_AND_ASSIGN(ProjectingObserver
);
53 #endif // ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_