• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
7 
8 #include "ash/ash_export.h"
9 #include "ash/shell_observer.h"
10 #include "base/basictypes.h"
11 #include "chromeos/display/output_configurator.h"
12 
13 namespace ash {
14 namespace internal {
15 
16 struct Resolution;
17 
18 // An object that observes changes in display configuration and
19 // update DisplayManagers.
20 class DisplayChangeObserver
21     : public chromeos::OutputConfigurator::StateController,
22       public chromeos::OutputConfigurator::Observer,
23       public ShellObserver {
24  public:
25   // Returns the resolution list.
26   ASH_EXPORT static std::vector<Resolution> GetResolutionList(
27       const chromeos::OutputConfigurator::OutputSnapshot& output);
28 
29   DisplayChangeObserver();
30   virtual ~DisplayChangeObserver();
31 
32   // chromeos::OutputConfigurator::StateController overrides:
33   virtual chromeos::OutputState GetStateForDisplayIds(
34       const std::vector<int64>& outputs) const OVERRIDE;
35   virtual bool GetResolutionForDisplayId(int64 display_id,
36                                          int* width,
37                                          int* height) const OVERRIDE;
38 
39   // Overriden from chromeos::OutputConfigurator::Observer:
40   virtual void OnDisplayModeChanged(
41       const std::vector<chromeos::OutputConfigurator::OutputSnapshot>& outputs)
42       OVERRIDE;
43 
44   // Overriden from ShellObserver:
45   virtual void OnAppTerminating() OVERRIDE;
46 
47  private:
48   DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver);
49 };
50 
51 }  // namespace internal
52 }  // namespace ash
53 
54 #endif  // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
55