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/base/win/shell.h" | 5 #include "ui/base/win/shell.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shlobj.h> // Must be before propkey. | 8 #include <shlobj.h> // Must be before propkey. |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 bool IsAeroGlassEnabled() { | 142 bool IsAeroGlassEnabled() { |
143 // For testing in Win8 (where it is not possible to disable composition) the | 143 // For testing in Win8 (where it is not possible to disable composition) the |
144 // user can specify this command line switch to mimic the behavior. In this | 144 // user can specify this command line switch to mimic the behavior. In this |
145 // mode, cross-HWND transparency is not supported and various types of | 145 // mode, cross-HWND transparency is not supported and various types of |
146 // widgets fallback to more simplified rendering behavior. | 146 // widgets fallback to more simplified rendering behavior. |
147 if (CommandLine::ForCurrentProcess()->HasSwitch( | 147 if (CommandLine::ForCurrentProcess()->HasSwitch( |
148 switches::kDisableDwmComposition)) | 148 switches::kDisableDwmComposition)) |
149 return false; | 149 return false; |
150 | 150 |
151 base::win::Version version = base::win::GetVersion(); | 151 // Technically Aero glass works in Vista but we want to put XP and Vista |
152 base::debug::Alias(&version); // TODO(scottmg): http://crbug.com/431549. | 152 // at the same feature level. See bug 426573. |
153 if (version < base::win::VERSION_VISTA) | 153 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
154 return false; | 154 return false; |
155 // If composition is not enabled, we behave like on XP. | 155 // If composition is not enabled, we behave like on XP. |
156 BOOL enabled = FALSE; | 156 BOOL enabled = FALSE; |
157 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; | 157 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; |
158 } | 158 } |
159 | 159 |
160 } // namespace win | 160 } // namespace win |
161 } // namespace ui | 161 } // namespace ui |
OLD | NEW |