1 // Copyright (c) 2011 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.
5 #include "ui/views/window/native_frame_view.h"
7 #include "ui/views/widget/native_widget.h"
8 #include "ui/views/widget/widget.h"
11 #include "ui/views/win/hwnd_util.h"
16 ////////////////////////////////////////////////////////////////////////////////
17 // NativeFrameView, public:
19 NativeFrameView::NativeFrameView(Widget* frame)
20 : NonClientFrameView(),
24 NativeFrameView::~NativeFrameView() {
27 ////////////////////////////////////////////////////////////////////////////////
28 // NativeFrameView, NonClientFrameView overrides:
30 gfx::Rect NativeFrameView::GetBoundsForClientView() const {
31 return gfx::Rect(0, 0, width(), height());
34 gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds(
35 const gfx::Rect& client_bounds) const {
37 return views::GetWindowBoundsForClientBounds(
38 static_cast<View*>(const_cast<NativeFrameView*>(this)), client_bounds);
45 int NativeFrameView::NonClientHitTest(const gfx::Point& point) {
46 return frame_->client_view()->NonClientHitTest(point);
49 void NativeFrameView::GetWindowMask(const gfx::Size& size,
50 gfx::Path* window_mask) {
51 // Nothing to do, we use the default window mask.
54 void NativeFrameView::ResetWindowControls() {
58 void NativeFrameView::UpdateWindowIcon() {
62 void NativeFrameView::UpdateWindowTitle() {
66 // Returns the client size. On Windows, this is the expected behavior for
67 // native frames (see |NativeWidgetWin::WidgetSizeIsClientSize()|), while other
68 // platforms currently always return client bounds from
69 // |GetWindowBoundsForClientBounds()|.
70 gfx::Size NativeFrameView::GetPreferredSize() {
71 return frame_->client_view()->GetPreferredSize();
74 gfx::Size NativeFrameView::GetMinimumSize() {
75 return frame_->client_view()->GetMinimumSize();
78 gfx::Size NativeFrameView::GetMaximumSize() {
79 return frame_->client_view()->GetMaximumSize();