| 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 UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ | 6 #define UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 9 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 10 #include "ui/display/types/chromeos/native_display_delegate.h" | 11 #include "ui/display/types/chromeos/native_display_delegate.h" |
| 11 | 12 |
| 12 namespace ui { | 13 namespace ui { |
| 13 | 14 |
| 15 class DisplayEventListener; |
| 14 class DisplaySnapshotDri; | 16 class DisplaySnapshotDri; |
| 15 class DriSurfaceFactory; | 17 class DriSurfaceFactory; |
| 16 | 18 |
| 17 class NativeDisplayDelegateDri : public NativeDisplayDelegate { | 19 class NativeDisplayDelegateDri : public NativeDisplayDelegate { |
| 18 public: | 20 public: |
| 19 NativeDisplayDelegateDri(DriSurfaceFactory* surface_factory); | 21 NativeDisplayDelegateDri(DriSurfaceFactory* surface_factory, |
| 22 scoped_ptr<DisplayEventListener> display_listener_); |
| 20 virtual ~NativeDisplayDelegateDri(); | 23 virtual ~NativeDisplayDelegateDri(); |
| 21 | 24 |
| 22 // NativeDisplayDelegate overrides: | 25 // NativeDisplayDelegate overrides: |
| 23 virtual void Initialize() OVERRIDE; | 26 virtual void Initialize() OVERRIDE; |
| 24 virtual void GrabServer() OVERRIDE; | 27 virtual void GrabServer() OVERRIDE; |
| 25 virtual void UngrabServer() OVERRIDE; | 28 virtual void UngrabServer() OVERRIDE; |
| 26 virtual void SyncWithServer() OVERRIDE; | 29 virtual void SyncWithServer() OVERRIDE; |
| 27 virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE; | 30 virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE; |
| 28 virtual void ForceDPMSOn() OVERRIDE; | 31 virtual void ForceDPMSOn() OVERRIDE; |
| 29 virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE; | 32 virtual std::vector<DisplaySnapshot*> GetDisplays() OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 40 virtual std::vector<ui::ColorCalibrationProfile> | 43 virtual std::vector<ui::ColorCalibrationProfile> |
| 41 GetAvailableColorCalibrationProfiles( | 44 GetAvailableColorCalibrationProfiles( |
| 42 const ui::DisplaySnapshot& output) OVERRIDE; | 45 const ui::DisplaySnapshot& output) OVERRIDE; |
| 43 virtual bool SetColorCalibrationProfile( | 46 virtual bool SetColorCalibrationProfile( |
| 44 const ui::DisplaySnapshot& output, | 47 const ui::DisplaySnapshot& output, |
| 45 ui::ColorCalibrationProfile new_profile) OVERRIDE; | 48 ui::ColorCalibrationProfile new_profile) OVERRIDE; |
| 46 virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; | 49 virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; |
| 47 virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; | 50 virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; |
| 48 | 51 |
| 49 private: | 52 private: |
| 53 // Callback for display events. |
| 54 void OnDisplayEvent(); |
| 55 |
| 50 DriSurfaceFactory* surface_factory_; // Not owned. | 56 DriSurfaceFactory* surface_factory_; // Not owned. |
| 57 scoped_ptr<DisplayEventListener> display_event_listener_; |
| 51 ScopedVector<const DisplayMode> cached_modes_; | 58 ScopedVector<const DisplayMode> cached_modes_; |
| 52 ScopedVector<DisplaySnapshotDri> cached_displays_; | 59 ScopedVector<DisplaySnapshotDri> cached_displays_; |
| 53 ObserverList<NativeDisplayObserver> observers_; | 60 ObserverList<NativeDisplayObserver> observers_; |
| 54 | 61 |
| 55 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateDri); | 62 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateDri); |
| 56 }; | 63 }; |
| 57 | 64 |
| 58 } // namespace ui | 65 } // namespace ui |
| 59 | 66 |
| 60 #endif // UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ | 67 #endif // UI_OZONE_PLATFORM_DRI_CHROMEOS_NATIVE_DISPLAY_DELEGATE_DRI_H_ |
| OLD | NEW |