root_view_mac.mm 738 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2018 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #include "atom/browser/ui/cocoa/root_view_mac.h"
  5. #include "atom/browser/native_window.h"
  6. namespace atom {
  7. RootViewMac::RootViewMac(NativeWindow* window) : window_(window) {
  8. set_owned_by_client();
  9. }
  10. RootViewMac::~RootViewMac() {}
  11. void RootViewMac::Layout() {
  12. if (!window_->content_view()) // Not ready yet.
  13. return;
  14. window_->content_view()->SetBoundsRect(gfx::Rect(gfx::Point(), size()));
  15. }
  16. gfx::Size RootViewMac::GetMinimumSize() const {
  17. return window_->GetMinimumSize();
  18. }
  19. gfx::Size RootViewMac::GetMaximumSize() const {
  20. return window_->GetMaximumSize();
  21. }
  22. } // namespace atom