display_change_observer_chromeos.h revision 23730a6e56a168d1879203e4b3819bb36e3d8f1f
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 "ui/display/chromeos/output_configurator.h" 12 13namespace ash { 14namespace internal { 15 16struct DisplayMode; 17 18// An object that observes changes in display configuration and 19// update DisplayManagers. 20class DisplayChangeObserver : public ui::OutputConfigurator::StateController, 21 public ui::OutputConfigurator::Observer, 22 public ShellObserver { 23 public: 24 // Returns the resolution list. 25 ASH_EXPORT static std::vector<DisplayMode> GetDisplayModeList( 26 const ui::OutputConfigurator::DisplayState& output); 27 28 DisplayChangeObserver(); 29 virtual ~DisplayChangeObserver(); 30 31 // ui::OutputConfigurator::StateController overrides: 32 virtual ui::OutputState GetStateForDisplayIds( 33 const std::vector<int64>& outputs) const OVERRIDE; 34 virtual bool GetResolutionForDisplayId(int64 display_id, 35 gfx::Size* size) const OVERRIDE; 36 37 // Overriden from ui::OutputConfigurator::Observer: 38 virtual void OnDisplayModeChanged( 39 const ui::OutputConfigurator::DisplayStateList& outputs) OVERRIDE; 40 41 // Overriden from ShellObserver: 42 virtual void OnAppTerminating() OVERRIDE; 43 44 private: 45 DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserver); 46}; 47 48} // namespace internal 49} // namespace ash 50 51#endif // ASH_DISPLAY_AURA_DISPLAY_CHANGE_OBSERVER_CHROMEOS_H 52