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