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 } | 13 } |
13 | 14 |
14 namespace display { | 15 namespace display { |
15 | 16 |
16 class PlatformScreen; | 17 class PlatformScreen; |
17 | 18 |
18 // The PlatformScreenDelegate will be informed of changes to the physical | 19 // The PlatformScreenDelegate will be informed of changes to the physical |
19 // and/or virtual displays by PlatformScreen. | 20 // and/or virtual displays by PlatformScreen. |
20 class PlatformScreenDelegate { | 21 class PlatformScreenDelegate { |
21 public: | 22 public: |
22 // TODO(kylechar): We need to provide more than just the window bounds when | 23 // Called when a display is added. |id| is the display id for the new display, |
23 // displays are added or modified. | 24 // |bounds| is the display origin and size in DIP, |pixel_size| is the size |
25 // of the display in DDP and |device_scale_factor| is the output device pixel | |
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; | |
sky
2016/09/22 21:42:06
Do you need to specify if the new display is the p
kylechar
2016/09/23 13:22:32
PlatformDisplay queries PlatformScreen to check if
| |
24 | 31 |
25 // Called when a display is added. |bounds| is in DIP. | 32 // Called when a display is removed. |id| is the display id for the display |
26 virtual void OnDisplayAdded(int64_t id, const gfx::Rect& bounds) = 0; | 33 // that was removed. |
27 | |
28 // Called when a display is removed. | |
29 virtual void OnDisplayRemoved(int64_t id) = 0; | 34 virtual void OnDisplayRemoved(int64_t id) = 0; |
30 | 35 |
31 // Called when a display is modified. |bounds| is in DIP. | 36 // Called when a display is modified. See |OnDisplayAdded| for parameter |
sky
2016/09/22 21:42:06
Generally we use params for function calls rather
kylechar
2016/09/23 13:22:32
Done.
| |
32 virtual void OnDisplayModified(int64_t id, const gfx::Rect& bounds) = 0; | 37 // information. |
38 virtual void OnDisplayModified(int64_t id, | |
39 const gfx::Rect& bounds, | |
40 const gfx::Size& pixel_size, | |
41 float device_scale_factor) = 0; | |
33 | 42 |
34 protected: | 43 protected: |
35 virtual ~PlatformScreenDelegate() {} | 44 virtual ~PlatformScreenDelegate() {} |
36 }; | 45 }; |
37 | 46 |
38 } // namespace display | 47 } // namespace display |
39 | 48 |
40 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ | 49 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_DELEGATE_H_ |
OLD | NEW |