shell_desktop_controller_mac.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_
  5. #define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_
  6. #include <memory>
  7. #include "base/memory/raw_ptr.h"
  8. #include "extensions/shell/browser/desktop_controller.h"
  9. #include "ui/display/screen.h"
  10. namespace extensions {
  11. class AppWindow;
  12. class AppWindowClient;
  13. // A simple implementation of the app_shell DesktopController for Mac Cocoa.
  14. // Only currently supports one app window (unlike Aura).
  15. class ShellDesktopControllerMac : public DesktopController {
  16. public:
  17. ShellDesktopControllerMac();
  18. ShellDesktopControllerMac(const ShellDesktopControllerMac&) = delete;
  19. ShellDesktopControllerMac& operator=(const ShellDesktopControllerMac&) =
  20. delete;
  21. ~ShellDesktopControllerMac() override;
  22. // DesktopController:
  23. void AddAppWindow(AppWindow* app_window, gfx::NativeWindow window) override;
  24. void CloseAppWindows() override;
  25. private:
  26. std::unique_ptr<AppWindowClient> app_window_client_;
  27. // The desktop only supports a single app window.
  28. // TODO(yoz): Support multiple app windows, as we do in Aura.
  29. raw_ptr<AppWindow> app_window_; // NativeAppWindow::Close() deletes this.
  30. display::ScopedNativeScreen screen_;
  31. };
  32. } // namespace extensions
  33. #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_