Chromium Code Reviews| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 base::win::Version version = base::win::GetVersion(); |
| 152 base::debug::Alias(&version); // TODO(scottmg): http://crbug.com/431549. | 152 base::debug::Alias(&version); // TODO(scottmg): http://crbug.com/431549. |
|
scottmg
2014/12/05 22:39:55
This is unnecessary now, would you mind deleting i
| |
| 153 if (version < base::win::VERSION_VISTA) | 153 // technically Aero glass works in Vista but we want to put XP and Vista |
|
scottmg
2014/12/05 22:39:55
nit; capital T.
| |
| 154 // at the same feature level. See bug 426573. | |
| 155 if (version < base::win::VERSION_WIN7) | |
| 154 return false; | 156 return false; |
| 155 // If composition is not enabled, we behave like on XP. | 157 // If composition is not enabled, we behave like on XP. |
| 156 BOOL enabled = FALSE; | 158 BOOL enabled = FALSE; |
| 157 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; | 159 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; |
| 158 } | 160 } |
| 159 | 161 |
| 160 } // namespace win | 162 } // namespace win |
| 161 } // namespace ui | 163 } // namespace ui |
| OLD | NEW |