OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "views/window/native_frame_view.h" | |
6 | |
7 #include "views/widget/native_widget.h" | |
8 #include "views/widget/widget.h" | |
9 | |
10 #if defined(OS_WIN) && !defined(USE_AURA) | |
11 #include "views/widget/native_widget_win.h" | |
12 #endif | |
13 | |
14 namespace views { | |
15 | |
16 //////////////////////////////////////////////////////////////////////////////// | |
17 // NativeFrameView, public: | |
18 | |
19 NativeFrameView::NativeFrameView(Widget* frame) | |
20 : NonClientFrameView(), | |
21 frame_(frame) { | |
22 } | |
23 | |
24 NativeFrameView::~NativeFrameView() { | |
25 } | |
26 | |
27 //////////////////////////////////////////////////////////////////////////////// | |
28 // NativeFrameView, NonClientFrameView overrides: | |
29 | |
30 gfx::Rect NativeFrameView::GetBoundsForClientView() const { | |
31 return gfx::Rect(0, 0, width(), height()); | |
32 } | |
33 | |
34 gfx::Rect NativeFrameView::GetWindowBoundsForClientBounds( | |
35 const gfx::Rect& client_bounds) const { | |
36 #if defined(OS_WIN) && !defined(USE_AURA) | |
37 RECT rect = client_bounds.ToRECT(); | |
38 NativeWidgetWin* widget_win = | |
39 static_cast<NativeWidgetWin*>(frame_->native_widget()); | |
40 AdjustWindowRectEx(&rect, widget_win->window_style(), FALSE, | |
41 widget_win->window_ex_style()); | |
42 return gfx::Rect(rect); | |
43 #else | |
44 // TODO(sad): | |
45 return client_bounds; | |
46 #endif | |
47 } | |
48 | |
49 int NativeFrameView::NonClientHitTest(const gfx::Point& point) { | |
50 return frame_->client_view()->NonClientHitTest(point); | |
51 } | |
52 | |
53 void NativeFrameView::GetWindowMask(const gfx::Size& size, | |
54 gfx::Path* window_mask) { | |
55 // Nothing to do, we use the default window mask. | |
56 } | |
57 | |
58 void NativeFrameView::EnableClose(bool enable) { | |
59 // Nothing to do, handled automatically by Window. | |
60 } | |
61 | |
62 void NativeFrameView::ResetWindowControls() { | |
63 // Nothing to do. | |
64 } | |
65 | |
66 void NativeFrameView::UpdateWindowIcon() { | |
67 // Nothing to do. | |
68 } | |
69 | |
70 gfx::Size NativeFrameView::GetPreferredSize() { | |
71 return frame_->client_view()->GetPreferredSize(); | |
72 } | |
73 | |
74 } // namespace views | |
OLD | NEW |