Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1998)

Unified Diff: ui/gfx/display_observer.h

Issue 259253002: Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/display_observer.h
diff --git a/ui/gfx/display_observer.h b/ui/gfx/display_observer.h
index ca97247f9ede0a165208aa69810b65f1870c710d..84641a4cddb45e99ac22fee848a60af739b1ca34 100644
--- a/ui/gfx/display_observer.h
+++ b/ui/gfx/display_observer.h
@@ -15,8 +15,13 @@ 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 DisplayMetrics {
+ 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,
+ };
// Called when |new_display| has been added.
virtual void OnDisplayAdded(const Display& new_display) = 0;
@@ -24,6 +29,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;
Elliot Glaysher 2014/05/12 17:47:11 Bitfields should be ints; enums imply mutual exclu
oshima 2014/05/12 19:58:13 Using enum for bitfield isn't uncommon (can be fou
+
protected:
virtual ~DisplayObserver();
};

Powered by Google App Engine
This is Rietveld 408576698