| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_GFX_DISPLAY_CHANGE_NOTIFIER_H_ | |
| 6 #define UI_GFX_DISPLAY_CHANGE_NOTIFIER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/observer_list.h" | |
| 12 #include "ui/gfx/gfx_export.h" | |
| 13 | |
| 14 namespace gfx { | |
| 15 | |
| 16 class Display; | |
| 17 class DisplayObserver; | |
| 18 | |
| 19 // DisplayChangeNotifier is a class implementing the handling of DisplayObserver | |
| 20 // notification for Screen. | |
| 21 class GFX_EXPORT DisplayChangeNotifier { | |
| 22 public: | |
| 23 DisplayChangeNotifier(); | |
| 24 ~DisplayChangeNotifier(); | |
| 25 | |
| 26 void AddObserver(DisplayObserver* observer); | |
| 27 | |
| 28 void RemoveObserver(DisplayObserver* observer); | |
| 29 | |
| 30 void NotifyDisplaysChanged(const std::vector<Display>& old_displays, | |
| 31 const std::vector<Display>& new_displays); | |
| 32 | |
| 33 private: | |
| 34 // The observers that need to be notified when a display is modified, added | |
| 35 // or removed. | |
| 36 base::ObserverList<DisplayObserver> observer_list_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(DisplayChangeNotifier); | |
| 39 }; | |
| 40 | |
| 41 } // namespace gfx | |
| 42 | |
| 43 #endif // UI_GFX_DISPLAY_CHANGE_NOTIFIER_H_ | |
| 44 | |
| OLD | NEW |