2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2014 GitHub, Inc.
|
2014-07-12 03:36:08 +00:00
|
|
|
// 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/views/win_frame_view.h"
|
2014-07-12 03:36:08 +00:00
|
|
|
|
2020-08-31 07:55:50 +00:00
|
|
|
#include "base/win/windows_version.h"
|
2019-06-19 20:46:59 +00:00
|
|
|
#include "shell/browser/native_window_views.h"
|
2014-07-12 03:36:08 +00:00
|
|
|
#include "ui/views/widget/widget.h"
|
|
|
|
#include "ui/views/win/hwnd_util.h"
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2014-07-12 03:36:08 +00:00
|
|
|
|
2018-06-25 20:30:00 +00:00
|
|
|
const char WinFrameView::kViewClassName[] = "WinFrameView";
|
2014-07-12 03:36:08 +00:00
|
|
|
|
2021-06-04 04:16:13 +00:00
|
|
|
WinFrameView::WinFrameView() = default;
|
2014-07-12 03:36:08 +00:00
|
|
|
|
2021-06-04 04:16:13 +00:00
|
|
|
WinFrameView::~WinFrameView() = default;
|
2014-07-12 03:36:08 +00:00
|
|
|
|
|
|
|
gfx::Rect WinFrameView::GetWindowBoundsForClientBounds(
|
|
|
|
const gfx::Rect& client_bounds) const {
|
2014-12-12 17:04:43 +00:00
|
|
|
return views::GetWindowBoundsForClientBounds(
|
|
|
|
static_cast<views::View*>(const_cast<WinFrameView*>(this)),
|
|
|
|
client_bounds);
|
2014-07-12 03:36:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int WinFrameView::NonClientHitTest(const gfx::Point& point) {
|
2014-07-16 07:33:40 +00:00
|
|
|
if (window_->has_frame())
|
|
|
|
return frame_->client_view()->NonClientHitTest(point);
|
|
|
|
else
|
|
|
|
return FramelessView::NonClientHitTest(point);
|
2014-07-12 03:36:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const char* WinFrameView::GetClassName() const {
|
|
|
|
return kViewClassName;
|
|
|
|
}
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|