OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/views/window/non_client_view.h" | 5 #include "chrome/views/window/non_client_view.h" |
6 | 6 |
| 7 #if defined(OS_WIN) |
7 #include "chrome/common/win_util.h" | 8 #include "chrome/common/win_util.h" |
| 9 #endif |
8 #include "chrome/views/widget/root_view.h" | 10 #include "chrome/views/widget/root_view.h" |
9 #include "chrome/views/widget/widget.h" | 11 #include "chrome/views/widget/widget.h" |
| 12 #if defined(OS_LINUX) |
| 13 #include "chrome/views/window/hit_test.h" |
| 14 #endif |
10 #include "chrome/views/window/window.h" | 15 #include "chrome/views/window/window.h" |
11 | 16 |
12 namespace views { | 17 namespace views { |
13 | 18 |
14 const int NonClientFrameView::kFrameShadowThickness = 1; | 19 const int NonClientFrameView::kFrameShadowThickness = 1; |
15 const int NonClientFrameView::kClientEdgeThickness = 1; | 20 const int NonClientFrameView::kClientEdgeThickness = 1; |
16 | 21 |
17 // The frame view and the client view are always at these specific indices, | 22 // The frame view and the client view are always at these specific indices, |
18 // because the RootView message dispatch sends messages to items higher in the | 23 // because the RootView message dispatch sends messages to items higher in the |
19 // z-order first and we always want the client view to have first crack at | 24 // z-order first and we always want the client view to have first crack at |
20 // handling mouse messages. | 25 // handling mouse messages. |
21 static const int kFrameViewIndex = 0; | 26 static const int kFrameViewIndex = 0; |
22 static const int kClientViewIndex = 1; | 27 static const int kClientViewIndex = 1; |
23 | 28 |
24 //////////////////////////////////////////////////////////////////////////////// | 29 //////////////////////////////////////////////////////////////////////////////// |
25 // NonClientView, public: | 30 // NonClientView, public: |
26 | 31 |
27 NonClientView::NonClientView(Window* frame) | 32 NonClientView::NonClientView(Window* frame) |
28 : frame_(frame), | 33 : frame_(frame), |
29 client_view_(NULL), | 34 client_view_(NULL), |
| 35 #if defined(OS_WIN) |
30 use_native_frame_(win_util::ShouldUseVistaFrame()) { | 36 use_native_frame_(win_util::ShouldUseVistaFrame()) { |
| 37 #else |
| 38 use_native_frame_(false) { |
| 39 #endif |
31 } | 40 } |
32 | 41 |
33 NonClientView::~NonClientView() { | 42 NonClientView::~NonClientView() { |
34 // This value may have been reset before the window hierarchy shuts down, | 43 // This value may have been reset before the window hierarchy shuts down, |
35 // so we need to manually remove it. | 44 // so we need to manually remove it. |
36 RemoveChildView(frame_view_.get()); | 45 RemoveChildView(frame_view_.get()); |
37 } | 46 } |
38 | 47 |
39 void NonClientView::SetFrameView(NonClientFrameView* frame_view) { | 48 void NonClientView::SetFrameView(NonClientFrameView* frame_view) { |
40 // See comment in header about ownership. | 49 // See comment in header about ownership. |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } else { | 255 } else { |
247 return HTNOWHERE; | 256 return HTNOWHERE; |
248 } | 257 } |
249 | 258 |
250 // If the window can't be resized, there are no resize boundaries, just | 259 // If the window can't be resized, there are no resize boundaries, just |
251 // window borders. | 260 // window borders. |
252 return can_resize ? component : HTBORDER; | 261 return can_resize ? component : HTBORDER; |
253 } | 262 } |
254 | 263 |
255 } // namespace views | 264 } // namespace views |
OLD | NEW |