| 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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/debug/alias.h" |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/native_library.h" | 15 #include "base/native_library.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/win/metro.h" | 17 #include "base/win/metro.h" |
| 17 #include "base/win/scoped_comptr.h" | 18 #include "base/win/scoped_comptr.h" |
| 18 #include "base/win/win_util.h" | 19 #include "base/win/win_util.h" |
| 19 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
| 20 #include "ui/base/ui_base_switches.h" | 21 #include "ui/base/ui_base_switches.h" |
| 21 | 22 |
| 22 namespace ui { | 23 namespace ui { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 140 |
| 140 bool IsAeroGlassEnabled() { | 141 bool IsAeroGlassEnabled() { |
| 141 // For testing in Win8 (where it is not possible to disable composition) the | 142 // For testing in Win8 (where it is not possible to disable composition) the |
| 142 // user can specify this command line switch to mimic the behavior. In this | 143 // user can specify this command line switch to mimic the behavior. In this |
| 143 // mode, cross-HWND transparency is not supported and various types of | 144 // mode, cross-HWND transparency is not supported and various types of |
| 144 // widgets fallback to more simplified rendering behavior. | 145 // widgets fallback to more simplified rendering behavior. |
| 145 if (CommandLine::ForCurrentProcess()->HasSwitch( | 146 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 146 switches::kDisableDwmComposition)) | 147 switches::kDisableDwmComposition)) |
| 147 return false; | 148 return false; |
| 148 | 149 |
| 149 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 150 base::win::Version version = base::win::GetVersion(); |
| 151 base::debug::Alias(&version); // TODO(scottmg): http://crbug.com/431549. |
| 152 if (version < base::win::VERSION_VISTA) |
| 150 return false; | 153 return false; |
| 151 // If composition is not enabled, we behave like on XP. | 154 // If composition is not enabled, we behave like on XP. |
| 152 BOOL enabled = FALSE; | 155 BOOL enabled = FALSE; |
| 153 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; | 156 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; |
| 154 } | 157 } |
| 155 | 158 |
| 156 } // namespace win | 159 } // namespace win |
| 157 } // namespace ui | 160 } // namespace ui |
| OLD | NEW |