| 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_NATIVE_DISPLAY_DELEGATE_PROXY_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_PROXY_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_PROXY_H_ | 6 #define UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_PROXY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/files/file.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 12 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 13 #include "ui/display/types/native_display_delegate.h" | 14 #include "ui/display/types/native_display_delegate.h" |
| 14 #include "ui/events/ozone/device/device_event_observer.h" | 15 #include "ui/events/ozone/device/device_event_observer.h" |
| 15 #include "ui/ozone/public/gpu_platform_support_host.h" | 16 #include "ui/ozone/public/gpu_platform_support_host.h" |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 | 19 |
| 19 class DeviceManager; | 20 class DeviceManager; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 void OnChannelDestroyed(int host_id) override; | 68 void OnChannelDestroyed(int host_id) override; |
| 68 | 69 |
| 69 // IPC::Listener overrides: | 70 // IPC::Listener overrides: |
| 70 bool OnMessageReceived(const IPC::Message& message) override; | 71 bool OnMessageReceived(const IPC::Message& message) override; |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 void OnUpdateNativeDisplays( | 74 void OnUpdateNativeDisplays( |
| 74 const std::vector<DisplaySnapshot_Params>& displays); | 75 const std::vector<DisplaySnapshot_Params>& displays); |
| 75 void OnDisplayConfigured(int64_t display_id, bool status); | 76 void OnDisplayConfigured(int64_t display_id, bool status); |
| 76 | 77 |
| 78 void OnNewGraphicsDevice(const base::FilePath& path, base::File file); |
| 79 |
| 77 DriGpuPlatformSupportHost* proxy_; // Not owned. | 80 DriGpuPlatformSupportHost* proxy_; // Not owned. |
| 78 DeviceManager* device_manager_; // Not owned. | 81 DeviceManager* device_manager_; // Not owned. |
| 79 DisplayManager* display_manager_; // Not owned. | 82 DisplayManager* display_manager_; // Not owned. |
| 80 | 83 |
| 81 // Keeps track if there is a dummy display. This happens on initialization | 84 // Keeps track if there is a dummy display. This happens on initialization |
| 82 // when there is no connection to the GPU to update the displays. | 85 // when there is no connection to the GPU to update the displays. |
| 83 bool has_dummy_display_; | 86 bool has_dummy_display_; |
| 84 | 87 |
| 85 ScopedVector<DisplaySnapshot> displays_; | 88 ScopedVector<DisplaySnapshot> displays_; |
| 86 ObserverList<NativeDisplayObserver> observers_; | 89 ObserverList<NativeDisplayObserver> observers_; |
| 87 | 90 |
| 88 GetDisplaysCallback get_displays_callback_; | 91 GetDisplaysCallback get_displays_callback_; |
| 89 | 92 |
| 90 // Map between display_id and the configuration callback. | 93 // Map between display_id and the configuration callback. |
| 91 std::map<int64_t, ConfigureCallback> configure_callback_map_; | 94 std::map<int64_t, ConfigureCallback> configure_callback_map_; |
| 92 | 95 |
| 96 base::WeakPtrFactory<NativeDisplayDelegateProxy> weak_ptr_factory_; |
| 97 |
| 93 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateProxy); | 98 DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateProxy); |
| 94 }; | 99 }; |
| 95 | 100 |
| 96 } // namespace ui | 101 } // namespace ui |
| 97 | 102 |
| 98 #endif // UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_PROXY_H_ | 103 #endif // UI_OZONE_PLATFORM_DRI_NATIVE_DISPLAY_DELEGATE_PROXY_H_ |
| OLD | NEW |