2018-05-02 06:39:43 +00:00
|
|
|
// Copyright (c) 2018 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/ui/cocoa/root_view_mac.h"
|
2018-05-02 06:39:43 +00:00
|
|
|
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/native_window.h"
|
2018-05-02 06:39:43 +00:00
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2018-05-02 06:39:43 +00:00
|
|
|
|
|
|
|
RootViewMac::RootViewMac(NativeWindow* window) : window_(window) {
|
|
|
|
set_owned_by_client();
|
|
|
|
}
|
|
|
|
|
2021-06-04 04:16:13 +00:00
|
|
|
RootViewMac::~RootViewMac() = default;
|
2018-05-02 06:39:43 +00:00
|
|
|
|
|
|
|
void RootViewMac::Layout() {
|
2018-05-08 06:24:53 +00:00
|
|
|
if (!window_->content_view()) // Not ready yet.
|
2018-05-02 06:39:43 +00:00
|
|
|
return;
|
|
|
|
|
2018-05-08 06:24:53 +00:00
|
|
|
window_->content_view()->SetBoundsRect(gfx::Rect(gfx::Point(), size()));
|
2018-05-02 06:39:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Size RootViewMac::GetMinimumSize() const {
|
|
|
|
return window_->GetMinimumSize();
|
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Size RootViewMac::GetMaximumSize() const {
|
|
|
|
return window_->GetMaximumSize();
|
|
|
|
}
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|