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

Side by Side 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: jochen comments (inc. git cl format) 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 unified diff | Download patch
OLDNEW
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
8 #include "ui/gfx/gfx_export.h" 10 #include "ui/gfx/gfx_export.h"
9 11
10 namespace gfx { 12 namespace gfx {
11 class Display; 13 class Display;
12 14
13 // Observers for display configuration changes. 15 // Observers for display configuration changes.
14 // TODO(oshima): consolidate |WorkAreaWatcherObserver| and 16 // TODO(oshima): consolidate |WorkAreaWatcherObserver| and
15 // |DisplaySettingsProvier|. crbug.com/122863. 17 // |DisplaySettingsProvier|. crbug.com/122863.
16 class GFX_EXPORT DisplayObserver { 18 class GFX_EXPORT DisplayObserver {
17 public: 19 public:
18 // Called when the |display|'s bound has changed. 20 enum DisplayMetric {
19 virtual void OnDisplayBoundsChanged(const Display& display) = 0; 21 DISPLAY_METRICS_NONE = 0,
22 DISPLAY_METRICS_BOUNDS = 1 << 0,
23 DISPLAY_METRICS_WORK_AREA = 1 << 1,
24 DISPLAY_METRICS_DEVICE_SCALE_FACTOR = 1 << 2,
25 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.
26 };
27 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
20 28
21 // Called when |new_display| has been added. 29 // Called when |new_display| has been added.
22 virtual void OnDisplayAdded(const Display& new_display) = 0; 30 virtual void OnDisplayAdded(const Display& new_display) = 0;
23 31
24 // Called when |old_display| has been removed. 32 // Called when |old_display| has been removed.
25 virtual void OnDisplayRemoved(const Display& old_display) = 0; 33 virtual void OnDisplayRemoved(const Display& old_display) = 0;
26 34
35 // Called when a |display| has one or more metrics changed. |changed_metrics|
36 // will contain the information about the change, see |DisplayMetrics|.
37 virtual void OnDisplayMetricsChanged(const Display& display,
38 DisplayMetrics changed_metrics) = 0;
39
27 protected: 40 protected:
28 virtual ~DisplayObserver(); 41 virtual ~DisplayObserver();
29 }; 42 };
30 43
31 } // namespace gfx 44 } // namespace gfx
32 45
33 #endif // UI_GFX_DISPLAY_OBSERVER_H_ 46 #endif // UI_GFX_DISPLAY_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698