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 "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2174 if (params.transparent) | 2174 if (params.transparent) |
2175 ex_style |= WS_EX_LAYERED; | 2175 ex_style |= WS_EX_LAYERED; |
2176 if (params.has_dropshadow) { | 2176 if (params.has_dropshadow) { |
2177 class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? | 2177 class_style |= (base::win::GetVersion() < base::win::VERSION_XP) ? |
2178 0 : CS_DROPSHADOW; | 2178 0 : CS_DROPSHADOW; |
2179 } | 2179 } |
2180 | 2180 |
2181 // Set type-dependent style attributes. | 2181 // Set type-dependent style attributes. |
2182 switch (params.type) { | 2182 switch (params.type) { |
2183 case Widget::InitParams::TYPE_WINDOW: { | 2183 case Widget::InitParams::TYPE_WINDOW: { |
2184 // Do not pass other styles if custom frame is used. This is because | |
2185 // oherwise the height of the window cannot be shrinked beyond certain | |
2186 // point. | |
2187 if (GetWidget()->frame_type() == Widget::FRAME_TYPE_FORCE_CUSTOM) { | |
Ben Goodger (Google)
2011/06/23 20:48:55
This is incorrect. Custom frame windows need to ha
| |
2188 style |= WS_POPUP; | |
2189 break; | |
2190 } | |
2191 | |
2184 style |= WS_SYSMENU | WS_CAPTION; | 2192 style |= WS_SYSMENU | WS_CAPTION; |
2185 bool can_resize = GetWidget()->widget_delegate()->CanResize(); | 2193 bool can_resize = GetWidget()->widget_delegate()->CanResize(); |
2186 bool can_maximize = GetWidget()->widget_delegate()->CanMaximize(); | 2194 bool can_maximize = GetWidget()->widget_delegate()->CanMaximize(); |
2187 if (can_maximize) { | 2195 if (can_maximize) { |
2188 style |= WS_OVERLAPPEDWINDOW; | 2196 style |= WS_OVERLAPPEDWINDOW; |
2189 } else if (can_resize) { | 2197 } else if (can_resize) { |
2190 style |= WS_OVERLAPPED | WS_THICKFRAME; | 2198 style |= WS_OVERLAPPED | WS_THICKFRAME; |
2191 } | 2199 } |
2192 if (delegate_->IsDialogBox()) { | 2200 if (delegate_->IsDialogBox()) { |
2193 style |= DS_MODALFRAME; | 2201 style |= DS_MODALFRAME; |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2501 | 2509 |
2502 // And now, notify them that they have a brand new parent. | 2510 // And now, notify them that they have a brand new parent. |
2503 for (Widget::Widgets::iterator it = widgets.begin(); | 2511 for (Widget::Widgets::iterator it = widgets.begin(); |
2504 it != widgets.end(); ++it) { | 2512 it != widgets.end(); ++it) { |
2505 (*it)->NotifyNativeViewHierarchyChanged(true, new_parent); | 2513 (*it)->NotifyNativeViewHierarchyChanged(true, new_parent); |
2506 } | 2514 } |
2507 } | 2515 } |
2508 | 2516 |
2509 } // namespace internal | 2517 } // namespace internal |
2510 } // namespace views | 2518 } // namespace views |
OLD | NEW |