| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "views/widget/native_widget_win.h" | 5 #include "views/widget/native_widget_win.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2228 void NativeWidgetWin::SetInitParams(const Widget::InitParams& params) { | 2228 void NativeWidgetWin::SetInitParams(const Widget::InitParams& params) { |
| 2229 // Set non-style attributes. | 2229 // Set non-style attributes. |
| 2230 ownership_ = params.ownership; | 2230 ownership_ = params.ownership; |
| 2231 | 2231 |
| 2232 DWORD style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS; | 2232 DWORD style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS; |
| 2233 DWORD ex_style = 0; | 2233 DWORD ex_style = 0; |
| 2234 DWORD class_style = CS_DBLCLKS; | 2234 DWORD class_style = CS_DBLCLKS; |
| 2235 | 2235 |
| 2236 // Set type-independent style attributes. | 2236 // Set type-independent style attributes. |
| 2237 if (params.child) | 2237 if (params.child) |
| 2238 style |= WS_CHILD | WS_VISIBLE; | 2238 style |= WS_CHILD; |
| 2239 if (params.show_state == ui::SHOW_STATE_MAXIMIZED) | 2239 if (params.show_state == ui::SHOW_STATE_MAXIMIZED) |
| 2240 style |= WS_MAXIMIZE; | 2240 style |= WS_MAXIMIZE; |
| 2241 if (params.show_state == ui::SHOW_STATE_MINIMIZED) | 2241 if (params.show_state == ui::SHOW_STATE_MINIMIZED) |
| 2242 style |= WS_MINIMIZE; | 2242 style |= WS_MINIMIZE; |
| 2243 if (!params.accept_events) | 2243 if (!params.accept_events) |
| 2244 ex_style |= WS_EX_TRANSPARENT; | 2244 ex_style |= WS_EX_TRANSPARENT; |
| 2245 if (!params.can_activate) | 2245 if (!params.can_activate) |
| 2246 ex_style |= WS_EX_NOACTIVATE; | 2246 ex_style |= WS_EX_NOACTIVATE; |
| 2247 if (params.keep_on_top) | 2247 if (params.keep_on_top) |
| 2248 ex_style |= WS_EX_TOPMOST; | 2248 ex_style |= WS_EX_TOPMOST; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2271 // NOTE: Turning this off means we lose the close button, which is bad. | 2271 // NOTE: Turning this off means we lose the close button, which is bad. |
| 2272 // Turning it on though means the user can maximize or size the window | 2272 // Turning it on though means the user can maximize or size the window |
| 2273 // from the system menu, which is worse. We may need to provide our own | 2273 // from the system menu, which is worse. We may need to provide our own |
| 2274 // menu to get the close button to appear properly. | 2274 // menu to get the close button to appear properly. |
| 2275 // style &= ~WS_SYSMENU; | 2275 // style &= ~WS_SYSMENU; |
| 2276 } | 2276 } |
| 2277 ex_style |= delegate_->IsDialogBox() ? WS_EX_DLGMODALFRAME : 0; | 2277 ex_style |= delegate_->IsDialogBox() ? WS_EX_DLGMODALFRAME : 0; |
| 2278 break; | 2278 break; |
| 2279 } | 2279 } |
| 2280 case Widget::InitParams::TYPE_CONTROL: | 2280 case Widget::InitParams::TYPE_CONTROL: |
| 2281 style |= WS_VISIBLE; |
| 2281 break; | 2282 break; |
| 2282 case Widget::InitParams::TYPE_WINDOW_FRAMELESS: | 2283 case Widget::InitParams::TYPE_WINDOW_FRAMELESS: |
| 2283 style |= WS_POPUP; | 2284 style |= WS_POPUP; |
| 2284 break; | 2285 break; |
| 2285 case Widget::InitParams::TYPE_BUBBLE: | 2286 case Widget::InitParams::TYPE_BUBBLE: |
| 2286 style |= WS_POPUP; | 2287 style |= WS_POPUP; |
| 2287 style |= WS_CLIPCHILDREN; | 2288 style |= WS_CLIPCHILDREN; |
| 2288 break; | 2289 break; |
| 2289 case Widget::InitParams::TYPE_POPUP: | 2290 case Widget::InitParams::TYPE_POPUP: |
| 2290 style |= WS_POPUP; | 2291 style |= WS_POPUP; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2620 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2621 return (GetKeyState(VK_LBUTTON) & 0x80) || |
| 2621 (GetKeyState(VK_RBUTTON) & 0x80) || | 2622 (GetKeyState(VK_RBUTTON) & 0x80) || |
| 2622 (GetKeyState(VK_MBUTTON) & 0x80) || | 2623 (GetKeyState(VK_MBUTTON) & 0x80) || |
| 2623 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2624 (GetKeyState(VK_XBUTTON1) & 0x80) || |
| 2624 (GetKeyState(VK_XBUTTON2) & 0x80); | 2625 (GetKeyState(VK_XBUTTON2) & 0x80); |
| 2625 } | 2626 } |
| 2626 | 2627 |
| 2627 } // namespace internal | 2628 } // namespace internal |
| 2628 | 2629 |
| 2629 } // namespace views | 2630 } // namespace views |
| OLD | NEW |