Home | History | Annotate | Download | only in display
      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.
      4 
      5 #ifndef ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_
      6 #define ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_
      7 
      8 #include "ash/ash_export.h"
      9 #include "ui/display/chromeos/display_configurator.h"
     10 
     11 namespace ash {
     12 
     13 class ASH_EXPORT ProjectingObserver : public ui::DisplayConfigurator::Observer {
     14  public:
     15   ProjectingObserver();
     16   virtual ~ProjectingObserver();
     17 
     18   // Called when a casting session is started or stopped.
     19   void OnCastingSessionStartedOrStopped(bool started);
     20 
     21   // DisplayConfigurator::Observer implementation:
     22   virtual void OnDisplayModeChanged(
     23       const ui::DisplayConfigurator::DisplayStateList& outputs) OVERRIDE;
     24 
     25  private:
     26   // Sends the current projecting state to power manager.
     27   void SetIsProjecting();
     28 
     29   // True if at least one output is internal. This value is updated when
     30   // |OnDisplayModeChanged| is called.
     31   bool has_internal_output_;
     32 
     33   // Keeps track of the number of connected outputs.
     34   int output_count_;
     35 
     36   // Number of outstanding casting sessions.
     37   int casting_session_count_;
     38 
     39   DISALLOW_COPY_AND_ASSIGN(ProjectingObserver);
     40 };
     41 
     42 }  // namespace ash
     43 
     44 #endif  // ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_
     45