// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_DISPLAY_DISPLAY_OBSERVER_H_ #define UI_DISPLAY_DISPLAY_OBSERVER_H_ #include <stdint.h> #include <vector> #include "base/memory/raw_ptr.h" #include "base/observer_list_types.h" #include "ui/display/display_export.h" namespace display { class Display; enum class TabletState; Displays; // Observers for display configuration changes. class DISPLAY_EXPORT DisplayObserver : public base::CheckedObserver { … }; // Caller must ensure the lifetime of `observer` outlives ScopedDisplayObserver // and ScopedOptionalDisplayObserver. The "Optional" version does not care // whether there is a display::Screen::GetScreen() to observe or not and will // silently noop when there is not. The non-optional ScopedDisplayObserver // will CHECK that display::Screen::GetScreen() exists on construction to // receive events from. class DISPLAY_EXPORT ScopedOptionalDisplayObserver { … }; class DISPLAY_EXPORT ScopedDisplayObserver : public ScopedOptionalDisplayObserver { … }; } // namespace display #endif // UI_DISPLAY_DISPLAY_OBSERVER_H_