OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H | 5 #ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H |
6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H | 6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chromeos/display/output_configurator.h" | 11 #include "chromeos/display/output_configurator.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 struct Resolution; | 16 struct Resolution; |
17 | 17 |
18 // An object that observes changes in display configuration and | 18 // An object that observes changes in display configuration and |
19 // update DisplayManagers. | 19 // update DisplayManagers. |
20 class DisplayChangeObserver | 20 class DisplayChangeObserver |
21 : public chromeos::OutputConfigurator::StateController, | 21 : public chromeos::OutputConfigurator::StateController, |
22 public chromeos::OutputConfigurator::Observer, | 22 public chromeos::OutputConfigurator::Observer, |
23 public ShellObserver { | 23 public ShellObserver { |
24 public: | 24 public: |
25 // Returns true if the size info in the output_info isn't valid | |
26 // and should be ignored. This is exposed for testing. | |
27 // |mm_width| and |mm_height| are given in millimeters. | |
28 ASH_EXPORT static bool ShouldIgnoreSize(unsigned long mm_width, | |
29 unsigned long mm_height); | |
30 | |
31 // Returns the resolution list. | 25 // Returns the resolution list. |
32 ASH_EXPORT static std::vector<Resolution> GetResolutionList( | 26 ASH_EXPORT static std::vector<Resolution> GetResolutionList( |
33 const chromeos::OutputConfigurator::OutputSnapshot& output); | 27 const chromeos::OutputConfigurator::OutputSnapshot& output); |
34 | 28 |
35 DisplayChangeObserver(); | 29 DisplayChangeObserver(); |
36 virtual ~DisplayChangeObserver(); | 30 virtual ~DisplayChangeObserver(); |
37 | 31 |
38 // chromeos::OutputConfigurator::StateController overrides: | 32 // chromeos::OutputConfigurator::StateController overrides: |
39 virtual chromeos::OutputState GetStateForDisplayIds( | 33 virtual chromeos::OutputState GetStateForDisplayIds( |
40 const std::vector<int64>& outputs) const OVERRIDE; | 34 const std::vector<int64>& outputs) const OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
51 virtual void OnAppTerminating() OVERRIDE; | 45 virtual void OnAppTerminating() OVERRIDE; |
52 | 46 |
53 private: | 47 private: |
54 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver); | 48 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver); |
55 }; | 49 }; |
56 | 50 |
57 } // namespace internal | 51 } // namespace internal |
58 } // namespace ash | 52 } // namespace ash |
59 | 53 |
60 #endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H | 54 #endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H |
OLD | NEW |