OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/widget/widget_hwnd_utils.h" | 5 #include "ui/views/widget/widget_hwnd_utils.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // 2- The window must have WS_EX_COMPOSITED in the extended style. | 59 // 2- The window must have WS_EX_COMPOSITED in the extended style. |
60 // 3- The window must have WS_POPUP in its style. | 60 // 3- The window must have WS_POPUP in its style. |
61 // 4- The windows must not have WM_SIZEBOX, WS_THICKFRAME or WS_CAPTION in its | 61 // 4- The windows must not have WM_SIZEBOX, WS_THICKFRAME or WS_CAPTION in its |
62 // style. | 62 // style. |
63 // 5- When the window is created but before it is presented, call | 63 // 5- When the window is created but before it is presented, call |
64 // DwmExtendFrameIntoClientArea passing -1 as the margins. | 64 // DwmExtendFrameIntoClientArea passing -1 as the margins. |
65 if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW) { | 65 if (params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW) { |
66 if (ui::win::IsAeroGlassEnabled()) | 66 if (ui::win::IsAeroGlassEnabled()) |
67 *ex_style |= WS_EX_COMPOSITED; | 67 *ex_style |= WS_EX_COMPOSITED; |
68 } | 68 } |
69 if (params.has_dropshadow) { | 69 if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_DROP) { |
70 *class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? | 70 *class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? |
71 0 : CS_DROPSHADOW; | 71 0 : CS_DROPSHADOW; |
72 } | 72 } |
73 | 73 |
74 // Set type-dependent style attributes. | 74 // Set type-dependent style attributes. |
75 switch (params.type) { | 75 switch (params.type) { |
76 case Widget::InitParams::TYPE_PANEL: | 76 case Widget::InitParams::TYPE_PANEL: |
77 *ex_style |= WS_EX_TOPMOST; | 77 *ex_style |= WS_EX_TOPMOST; |
78 if (params.remove_standard_frame) { | 78 if (params.remove_standard_frame) { |
79 *style |= WS_POPUP; | 79 *style |= WS_POPUP; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 DWORD class_style = 0; | 153 DWORD class_style = 0; |
154 CalculateWindowStylesFromInitParams(params, widget_delegate, | 154 CalculateWindowStylesFromInitParams(params, widget_delegate, |
155 native_widget_delegate, &style, &ex_style, | 155 native_widget_delegate, &style, &ex_style, |
156 &class_style); | 156 &class_style); |
157 handler->set_initial_class_style(class_style); | 157 handler->set_initial_class_style(class_style); |
158 handler->set_window_style(handler->window_style() | style); | 158 handler->set_window_style(handler->window_style() | style); |
159 handler->set_window_ex_style(handler->window_ex_style() | ex_style); | 159 handler->set_window_ex_style(handler->window_ex_style() | ex_style); |
160 } | 160 } |
161 | 161 |
162 } // namespace views | 162 } // namespace views |
OLD | NEW |