| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_ | 5 #ifndef ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_ |
| 6 #define ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_ | 6 #define ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "chromeos/display/output_configurator.h" | 9 #include "ui/display/chromeos/output_configurator.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 | 12 |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 class ASH_EXPORT ProjectingObserver | 15 class ASH_EXPORT ProjectingObserver : public ui::OutputConfigurator::Observer { |
| 16 : public chromeos::OutputConfigurator::Observer { | |
| 17 public: | 16 public: |
| 18 ProjectingObserver(); | 17 ProjectingObserver(); |
| 19 virtual ~ProjectingObserver(); | 18 virtual ~ProjectingObserver(); |
| 20 | 19 |
| 21 // Called when a casting session is started or stopped. | 20 // Called when a casting session is started or stopped. |
| 22 void OnCastingSessionStartedOrStopped(bool started); | 21 void OnCastingSessionStartedOrStopped(bool started); |
| 23 | 22 |
| 24 // OutputConfigurator::Observer implementation: | 23 // OutputConfigurator::Observer implementation: |
| 25 virtual void OnDisplayModeChanged(const std::vector< | 24 virtual void OnDisplayModeChanged(const std::vector< |
| 26 chromeos::OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; | 25 ui::OutputConfigurator::OutputSnapshot>& outputs) OVERRIDE; |
| 27 | 26 |
| 28 private: | 27 private: |
| 29 // Sends the current projecting state to power manager. | 28 // Sends the current projecting state to power manager. |
| 30 void SetIsProjecting(); | 29 void SetIsProjecting(); |
| 31 | 30 |
| 32 // True if at least one output is internal. This value is updated when | 31 // True if at least one output is internal. This value is updated when |
| 33 // |OnDisplayModeChanged| is called. | 32 // |OnDisplayModeChanged| is called. |
| 34 bool has_internal_output_; | 33 bool has_internal_output_; |
| 35 | 34 |
| 36 // Keeps track of the number of connected outputs. | 35 // Keeps track of the number of connected outputs. |
| 37 int output_count_; | 36 int output_count_; |
| 38 | 37 |
| 39 // Number of outstanding casting sessions. | 38 // Number of outstanding casting sessions. |
| 40 int casting_session_count_; | 39 int casting_session_count_; |
| 41 | 40 |
| 42 DISALLOW_COPY_AND_ASSIGN(ProjectingObserver); | 41 DISALLOW_COPY_AND_ASSIGN(ProjectingObserver); |
| 43 }; | 42 }; |
| 44 | 43 |
| 45 } // namespace internal | 44 } // namespace internal |
| 46 | 45 |
| 47 } // namespace ash | 46 } // namespace ash |
| 48 | 47 |
| 49 #endif // ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_ | 48 #endif // ASH_DISPLAY_PROJECTING_OBSERVER_CHROMEOS_H_ |
| OLD | NEW |