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 "ui/views/widget/native_widget_win.h" | 5 #include "ui/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 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 ex_style |= l10n_util::GetExtendedTooltipStyles(); | 2125 ex_style |= l10n_util::GetExtendedTooltipStyles(); |
2126 if (params.transparent) | 2126 if (params.transparent) |
2127 ex_style |= WS_EX_LAYERED; | 2127 ex_style |= WS_EX_LAYERED; |
2128 if (params.has_dropshadow) { | 2128 if (params.has_dropshadow) { |
2129 class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? | 2129 class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? |
2130 0 : CS_DROPSHADOW; | 2130 0 : CS_DROPSHADOW; |
2131 } | 2131 } |
2132 | 2132 |
2133 // Set type-dependent style attributes. | 2133 // Set type-dependent style attributes. |
2134 switch (params.type) { | 2134 switch (params.type) { |
| 2135 case Widget::InitParams::TYPE_PANEL: |
| 2136 ex_style |= WS_EX_TOPMOST; |
| 2137 // No break. Fall through to TYPE_WINDOW. |
2135 case Widget::InitParams::TYPE_WINDOW: { | 2138 case Widget::InitParams::TYPE_WINDOW: { |
2136 style |= WS_SYSMENU | WS_CAPTION; | 2139 style |= WS_SYSMENU | WS_CAPTION; |
2137 bool can_resize = GetWidget()->widget_delegate()->CanResize(); | 2140 bool can_resize = GetWidget()->widget_delegate()->CanResize(); |
2138 bool can_maximize = GetWidget()->widget_delegate()->CanMaximize(); | 2141 bool can_maximize = GetWidget()->widget_delegate()->CanMaximize(); |
2139 if (can_maximize) { | 2142 if (can_maximize) { |
2140 style |= WS_OVERLAPPEDWINDOW; | 2143 style |= WS_OVERLAPPEDWINDOW; |
2141 } else if (can_resize) { | 2144 } else if (can_resize) { |
2142 style |= WS_OVERLAPPED | WS_THICKFRAME; | 2145 style |= WS_OVERLAPPED | WS_THICKFRAME; |
2143 } | 2146 } |
2144 if (delegate_->IsDialogBox()) { | 2147 if (delegate_->IsDialogBox()) { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2488 return (GetKeyState(VK_LBUTTON) & 0x80) || | 2491 return (GetKeyState(VK_LBUTTON) & 0x80) || |
2489 (GetKeyState(VK_RBUTTON) & 0x80) || | 2492 (GetKeyState(VK_RBUTTON) & 0x80) || |
2490 (GetKeyState(VK_MBUTTON) & 0x80) || | 2493 (GetKeyState(VK_MBUTTON) & 0x80) || |
2491 (GetKeyState(VK_XBUTTON1) & 0x80) || | 2494 (GetKeyState(VK_XBUTTON1) & 0x80) || |
2492 (GetKeyState(VK_XBUTTON2) & 0x80); | 2495 (GetKeyState(VK_XBUTTON2) & 0x80); |
2493 } | 2496 } |
2494 | 2497 |
2495 } // namespace internal | 2498 } // namespace internal |
2496 | 2499 |
2497 } // namespace views | 2500 } // namespace views |
OLD | NEW |