-
Notifications
You must be signed in to change notification settings - Fork 15k
/
native_frame_view.cc
31 lines (22 loc) · 982 Bytes
/
native_frame_view.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "shell/browser/ui/views/native_frame_view.h"
#include "shell/browser/native_window.h"
namespace electron {
const char NativeFrameView::kViewClassName[] = "ElectronNativeFrameView";
NativeFrameView::NativeFrameView(NativeWindow* window, views::Widget* widget)
: views::NativeFrameView(widget), window_(window) {}
gfx::Size NativeFrameView::GetMinimumSize() const {
return window_->GetMinimumSize();
}
gfx::Size NativeFrameView::GetMaximumSize() const {
gfx::Size size = window_->GetMaximumSize();
// Electron public APIs returns (0, 0) when maximum size is not set, but it
// would break internal window APIs like HWNDMessageHandler::SetAspectRatio.
return size.IsEmpty() ? gfx::Size(INT_MAX, INT_MAX) : size;
}
const char* NativeFrameView::GetClassName() const {
return kViewClassName;
}
} // namespace electron