OLD | NEW |
1 // Copyright (c) 2010 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 "app/win/hwnd_util.h" | 5 #include "ui/base/win/hwnd_util.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
11 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
12 #include "gfx/size.h" | 12 #include "gfx/size.h" |
13 | 13 |
14 #pragma comment(lib, "dwmapi.lib") | 14 #pragma comment(lib, "dwmapi.lib") |
15 | 15 |
16 namespace app { | 16 namespace ui { |
17 namespace win { | |
18 | 17 |
19 namespace { | 18 namespace { |
20 | 19 |
21 // Adjust the window to fit, returning true if the window was resized or moved. | 20 // Adjust the window to fit, returning true if the window was resized or moved. |
22 bool AdjustWindowToFit(HWND hwnd, const RECT& bounds) { | 21 bool AdjustWindowToFit(HWND hwnd, const RECT& bounds) { |
23 // Get the monitor. | 22 // Get the monitor. |
24 HMONITOR hmon = MonitorFromRect(&bounds, MONITOR_DEFAULTTONEAREST); | 23 HMONITOR hmon = MonitorFromRect(&bounds, MONITOR_DEFAULTTONEAREST); |
25 if (!hmon) { | 24 if (!hmon) { |
26 NOTREACHED() << "Unable to find default monitor"; | 25 NOTREACHED() << "Unable to find default monitor"; |
27 // No monitor available. | 26 // No monitor available. |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 171 |
173 bool ShouldUseVistaFrame() { | 172 bool ShouldUseVistaFrame() { |
174 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 173 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
175 return false; | 174 return false; |
176 // If composition is not enabled, we behave like on XP. | 175 // If composition is not enabled, we behave like on XP. |
177 BOOL f; | 176 BOOL f; |
178 DwmIsCompositionEnabled(&f); | 177 DwmIsCompositionEnabled(&f); |
179 return !!f; | 178 return !!f; |
180 } | 179 } |
181 | 180 |
182 } // namespace win | 181 } // namespace ui |
183 } // namespace app | |
OLD | NEW |