scoped_display_for_new_windows.h 966 B

123456789101112131415161718192021222324252627
  1. // Copyright 2020 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. #ifndef UI_DISPLAY_SCOPED_DISPLAY_FOR_NEW_WINDOWS_H_
  5. #define UI_DISPLAY_SCOPED_DISPLAY_FOR_NEW_WINDOWS_H_
  6. #include "ui/display/screen.h"
  7. #include "ui/gfx/native_widget_types.h"
  8. namespace display {
  9. // Constructing a ScopedDisplayForNewWindows allows temporarily switching
  10. // display for new windows during the lifetime of this object.
  11. class DISPLAY_EXPORT ScopedDisplayForNewWindows {
  12. public:
  13. explicit ScopedDisplayForNewWindows(int64_t new_display);
  14. explicit ScopedDisplayForNewWindows(gfx::NativeView view);
  15. ~ScopedDisplayForNewWindows();
  16. ScopedDisplayForNewWindows(const ScopedDisplayForNewWindows&) = delete;
  17. ScopedDisplayForNewWindows& operator=(const ScopedDisplayForNewWindows&) =
  18. delete;
  19. };
  20. } // namespace display
  21. #endif // UI_DISPLAY_SCOPED_DISPLAY_FOR_NEW_WINDOWS_H_