Index: ui/gfx/display_observer.h |
diff --git a/ui/gfx/display_observer.h b/ui/gfx/display_observer.h |
index ca97247f9ede0a165208aa69810b65f1870c710d..92b08d5328d581720b684f381616cc19edb38605 100644 |
--- a/ui/gfx/display_observer.h |
+++ b/ui/gfx/display_observer.h |
@@ -5,6 +5,8 @@ |
#ifndef UI_GFX_DISPLAY_OBSERVER_H_ |
#define UI_GFX_DISPLAY_OBSERVER_H_ |
+#include <stdint.h> |
+ |
#include "ui/gfx/gfx_export.h" |
namespace gfx { |
@@ -15,8 +17,14 @@ class Display; |
// |DisplaySettingsProvier|. crbug.com/122863. |
class GFX_EXPORT DisplayObserver { |
public: |
- // Called when the |display|'s bound has changed. |
- virtual void OnDisplayBoundsChanged(const Display& display) = 0; |
+ enum DisplayMetric { |
+ DISPLAY_METRICS_NONE = 0, |
+ DISPLAY_METRICS_BOUNDS = 1 << 0, |
+ DISPLAY_METRICS_WORK_AREA = 1 << 1, |
+ DISPLAY_METRICS_DEVICE_SCALE_FACTOR = 1 << 2, |
+ DISPLAY_METRICS_ROTATION = 1 << 3, |
oshima
2014/05/20 01:03:02
DISPLAY_METRIC_ (be consistent with enum type)
mlamouri (slow - plz ping)
2014/05/20 12:52:58
Done.
|
+ }; |
+ typedef uint8_t DisplayMetrics; |
oshima
2014/05/20 01:03:02
My preference is just to use uint32. unit32 is mor
mlamouri (slow - plz ping)
2014/05/20 12:52:58
I changed this but for the record, I would have pr
|
// Called when |new_display| has been added. |
virtual void OnDisplayAdded(const Display& new_display) = 0; |
@@ -24,6 +32,11 @@ class GFX_EXPORT DisplayObserver { |
// Called when |old_display| has been removed. |
virtual void OnDisplayRemoved(const Display& old_display) = 0; |
+ // Called when a |display| has one or more metrics changed. |changed_metrics| |
+ // will contain the information about the change, see |DisplayMetrics|. |
+ virtual void OnDisplayMetricsChanged(const Display& display, |
+ DisplayMetrics changed_metrics) = 0; |
+ |
protected: |
virtual ~DisplayObserver(); |
}; |