| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GFX_DISPLAY_OBSERVER_H_ | 5 #ifndef UI_GFX_DISPLAY_OBSERVER_H_ |
| 6 #define UI_GFX_DISPLAY_OBSERVER_H_ | 6 #define UI_GFX_DISPLAY_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "ui/gfx/gfx_export.h" | 8 #include "ui/gfx/gfx_export.h" |
| 11 | 9 |
| 12 namespace gfx { | 10 namespace gfx { |
| 13 class Display; | 11 class Display; |
| 14 | 12 |
| 15 // Observers for display configuration changes. | 13 // Observers for display configuration changes. |
| 16 // TODO(oshima): consolidate |WorkAreaWatcherObserver| and | 14 // TODO(oshima): consolidate |WorkAreaWatcherObserver| and |
| 17 // |DisplaySettingsProvier|. crbug.com/122863. | 15 // |DisplaySettingsProvier|. crbug.com/122863. |
| 18 class GFX_EXPORT DisplayObserver { | 16 class GFX_EXPORT DisplayObserver { |
| 19 public: | 17 public: |
| 20 enum DisplayMetric { | 18 // Called when the |display|'s bound has changed. |
| 21 DISPLAY_METRIC_NONE = 0, | 19 virtual void OnDisplayBoundsChanged(const Display& display) = 0; |
| 22 DISPLAY_METRIC_BOUNDS = 1 << 0, | |
| 23 DISPLAY_METRIC_WORK_AREA = 1 << 1, | |
| 24 DISPLAY_METRIC_DEVICE_SCALE_FACTOR = 1 << 2, | |
| 25 DISPLAY_METRIC_ROTATION = 1 << 3, | |
| 26 }; | |
| 27 | 20 |
| 28 // Called when |new_display| has been added. | 21 // Called when |new_display| has been added. |
| 29 virtual void OnDisplayAdded(const Display& new_display) = 0; | 22 virtual void OnDisplayAdded(const Display& new_display) = 0; |
| 30 | 23 |
| 31 // Called when |old_display| has been removed. | 24 // Called when |old_display| has been removed. |
| 32 virtual void OnDisplayRemoved(const Display& old_display) = 0; | 25 virtual void OnDisplayRemoved(const Display& old_display) = 0; |
| 33 | 26 |
| 34 // Called when a |display| has one or more metrics changed. |changed_metrics| | |
| 35 // will contain the information about the change, see |DisplayMetric|. | |
| 36 virtual void OnDisplayMetricsChanged(const Display& display, | |
| 37 uint32_t changed_metrics) = 0; | |
| 38 | |
| 39 protected: | 27 protected: |
| 40 virtual ~DisplayObserver(); | 28 virtual ~DisplayObserver(); |
| 41 }; | 29 }; |
| 42 | 30 |
| 43 } // namespace gfx | 31 } // namespace gfx |
| 44 | 32 |
| 45 #endif // UI_GFX_DISPLAY_OBSERVER_H_ | 33 #endif // UI_GFX_DISPLAY_OBSERVER_H_ |
| OLD | NEW |