| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ | 5 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ |
| 6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ | 6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 namespace gfx { | 10 namespace gfx { |
| 11 class Rect; | 11 class Rect; |
| 12 class Size; | 12 class Size; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace display { | 15 namespace display { |
| 16 | 16 |
| 17 class PlatformScreen; | 17 class PlatformScreen; |
| 18 struct ViewportMetrics; |
| 18 | 19 |
| 19 // The PlatformScreenDelegate will be informed of changes to the physical | 20 // The PlatformScreenDelegate will be informed of changes to the physical |
| 20 // and/or virtual displays by PlatformScreen. | 21 // and/or virtual displays by PlatformScreen. |
| 21 class PlatformScreenDelegate { | 22 class PlatformScreenDelegate { |
| 22 public: | 23 public: |
| 23 // Called when a display is added. |id| is the display id for the new display, | 24 // Called when a display is added. |id| is the display id of the new display |
| 24 // |bounds| is the display origin and size in DIP, |pixel_size| is the size | 25 // and |metrics| contains display viewport information. |
| 25 // of the display in DDP and |device_scale_factor| is the output device pixel | 26 virtual void OnDisplayAdded(int64_t id, const ViewportMetrics& metrics) = 0; |
| 26 // scale factor. | |
| 27 virtual void OnDisplayAdded(int64_t id, | |
| 28 const gfx::Rect& bounds, | |
| 29 const gfx::Size& pixel_size, | |
| 30 float device_scale_factor) = 0; | |
| 31 | 27 |
| 32 // Called when a display is removed. |id| is the display id for the display | 28 // Called when a display is removed. |id| is the display id of the display |
| 33 // that was removed. | 29 // that was removed. |
| 34 virtual void OnDisplayRemoved(int64_t id) = 0; | 30 virtual void OnDisplayRemoved(int64_t id) = 0; |
| 35 | 31 |
| 36 // Called when a display is modified. See OnDisplayAdded() for parameter | 32 // Called when a display is modified. |id| is the display id of the modified |
| 37 // information. | 33 // display and |metrics| contains updated display viewport information. |
| 38 virtual void OnDisplayModified(int64_t id, | 34 virtual void OnDisplayModified(int64_t id, |
| 39 const gfx::Rect& bounds, | 35 const ViewportMetrics& metrics) = 0; |
| 40 const gfx::Size& pixel_size, | |
| 41 float device_scale_factor) = 0; | |
| 42 | 36 |
| 43 protected: | 37 protected: |
| 44 virtual ~PlatformScreenDelegate() {} | 38 virtual ~PlatformScreenDelegate() {} |
| 45 }; | 39 }; |
| 46 | 40 |
| 47 } // namespace display | 41 } // namespace display |
| 48 | 42 |
| 49 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ | 43 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ |
| OLD | NEW |