Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / display / display_change_observer_chromeos.h
blob346f35de45311ffc544fbcd2ad3946ef8b0b9c61
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.
5 #ifndef ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
6 #define ASH_DISPLAY_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H
8 #include "ash/ash_export.h"
9 #include "ash/shell_observer.h"
10 #include "base/basictypes.h"
11 #include "ui/display/chromeos/display_configurator.h"
13 namespace ash {
15 class DisplayInfo;
16 struct DisplayMode;
18 // An object that observes changes in display configuration and
19 // update DisplayManagers.
20 class DisplayChangeObserver : public ui::DisplayConfigurator::StateController,
21 public ui::DisplayConfigurator::Observer,
22 public ShellObserver {
23 public:
24 // Returns the mode list for internal display.
25 ASH_EXPORT static std::vector<DisplayMode> GetInternalDisplayModeList(
26 const DisplayInfo& display_info,
27 const ui::DisplayConfigurator::DisplayState& output);
29 // Returns the resolution list.
30 ASH_EXPORT static std::vector<DisplayMode> GetExternalDisplayModeList(
31 const ui::DisplayConfigurator::DisplayState& output);
33 DisplayChangeObserver();
34 virtual ~DisplayChangeObserver();
36 // ui::DisplayConfigurator::StateController overrides:
37 virtual ui::MultipleDisplayState GetStateForDisplayIds(
38 const std::vector<int64>& outputs) const OVERRIDE;
39 virtual bool GetResolutionForDisplayId(int64 display_id,
40 gfx::Size* size) const OVERRIDE;
42 // Overriden from ui::DisplayConfigurator::Observer:
43 virtual void OnDisplayModeChanged(
44 const ui::DisplayConfigurator::DisplayStateList& outputs) OVERRIDE;
46 // Overriden from ShellObserver:
47 virtual void OnAppTerminating() OVERRIDE;
49 // Exposed for testing.
50 ASH_EXPORT static float FindDeviceScaleFactor(float dpi);
52 private:
53 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver);
56 } // namespace ash
58 #endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H