| 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 "chrome/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 #endif // ENABLE_EXTENSIONS | 122 #endif // ENABLE_EXTENSIONS |
| 123 | 123 |
| 124 #if defined(USE_ASH) | 124 #if defined(USE_ASH) |
| 125 #include "ash/common/ash_switches.h" | 125 #include "ash/common/ash_switches.h" |
| 126 #endif // USE_ASH | 126 #endif // USE_ASH |
| 127 | 127 |
| 128 #if defined(USE_OZONE) | 128 #if defined(USE_OZONE) |
| 129 #include "ui/ozone/public/ozone_switches.h" | 129 #include "ui/ozone/public/ozone_switches.h" |
| 130 #endif // USE_OZONE | 130 #endif // USE_OZONE |
| 131 | 131 |
| 132 #if defined(OS_WIN) |
| 133 #include "base/win/windows_version.h" |
| 134 #endif // OS_WIN |
| 135 |
| 132 using flags_ui::FeatureEntry; | 136 using flags_ui::FeatureEntry; |
| 133 using flags_ui::kOsMac; | 137 using flags_ui::kOsMac; |
| 134 using flags_ui::kOsWin; | 138 using flags_ui::kOsWin; |
| 135 using flags_ui::kOsLinux; | 139 using flags_ui::kOsLinux; |
| 136 using flags_ui::kOsCrOS; | 140 using flags_ui::kOsCrOS; |
| 137 using flags_ui::kOsAndroid; | 141 using flags_ui::kOsAndroid; |
| 138 using flags_ui::kOsCrOSOwnerOnly; | 142 using flags_ui::kOsCrOSOwnerOnly; |
| 139 | 143 |
| 140 namespace about_flags { | 144 namespace about_flags { |
| 141 | 145 |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 ash::switches::kAshDisableScreenOrientationLock), | 1116 ash::switches::kAshDisableScreenOrientationLock), |
| 1113 }, | 1117 }, |
| 1114 #endif // OS_CHROMEOS | 1118 #endif // OS_CHROMEOS |
| 1115 { | 1119 { |
| 1116 "disable-accelerated-video-decode", | 1120 "disable-accelerated-video-decode", |
| 1117 flag_descriptions::kAcceleratedVideoDecodeName, | 1121 flag_descriptions::kAcceleratedVideoDecodeName, |
| 1118 flag_descriptions::kAcceleratedVideoDecodeDescription, | 1122 flag_descriptions::kAcceleratedVideoDecodeDescription, |
| 1119 kOsMac | kOsWin | kOsCrOS | kOsAndroid, | 1123 kOsMac | kOsWin | kOsCrOS | kOsAndroid, |
| 1120 SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), | 1124 SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode), |
| 1121 }, | 1125 }, |
| 1126 #if defined(OS_WIN) |
| 1127 { |
| 1128 "enable-hdr", flag_descriptions::kEnableHDRName, |
| 1129 flag_descriptions::kEnableHDRDescription, kOsWin, |
| 1130 SINGLE_VALUE_TYPE(switches::kEnableHDR), |
| 1131 }, |
| 1132 #endif // OS_WIN |
| 1122 #if defined(USE_ASH) | 1133 #if defined(USE_ASH) |
| 1123 { | 1134 { |
| 1124 "ash-debug-shortcuts", flag_descriptions::kDebugShortcutsName, | 1135 "ash-debug-shortcuts", flag_descriptions::kDebugShortcutsName, |
| 1125 flag_descriptions::kDebugShortcutsDescription, kOsAll, | 1136 flag_descriptions::kDebugShortcutsDescription, kOsAll, |
| 1126 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts), | 1137 SINGLE_VALUE_TYPE(ash::switches::kAshDebugShortcuts), |
| 1127 }, | 1138 }, |
| 1128 { | 1139 { |
| 1129 "ash-disable-maximize-mode-window-backdrop", | 1140 "ash-disable-maximize-mode-window-backdrop", |
| 1130 flag_descriptions::kAshMaximizeModeWindowBackdropName, | 1141 flag_descriptions::kAshMaximizeModeWindowBackdropName, |
| 1131 flag_descriptions::kAshMaximizeModeWindowBackdropDescription, kOsCrOS, | 1142 flag_descriptions::kAshMaximizeModeWindowBackdropDescription, kOsCrOS, |
| (...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2540 if ((!strcmp("data-reduction-proxy-lo-fi", entry.internal_name) || | 2551 if ((!strcmp("data-reduction-proxy-lo-fi", entry.internal_name) || |
| 2541 !strcmp("enable-data-reduction-proxy-lite-page", | 2552 !strcmp("enable-data-reduction-proxy-lite-page", |
| 2542 entry.internal_name)) && | 2553 entry.internal_name)) && |
| 2543 channel != version_info::Channel::BETA && | 2554 channel != version_info::Channel::BETA && |
| 2544 channel != version_info::Channel::DEV && | 2555 channel != version_info::Channel::DEV && |
| 2545 channel != version_info::Channel::CANARY && | 2556 channel != version_info::Channel::CANARY && |
| 2546 channel != version_info::Channel::UNKNOWN) { | 2557 channel != version_info::Channel::UNKNOWN) { |
| 2547 return true; | 2558 return true; |
| 2548 } | 2559 } |
| 2549 | 2560 |
| 2561 #if defined(OS_WIN) |
| 2562 // HDR mode works, but displays everything horribly wrong prior to windows 10. |
| 2563 if (!strcmp("enable-hdr", entry.internal_name) && |
| 2564 base::win::GetVersion() < base::win::Version::VERSION_WIN10) { |
| 2565 return true; |
| 2566 } |
| 2567 #endif // OS_WIN |
| 2568 |
| 2550 return false; | 2569 return false; |
| 2551 } | 2570 } |
| 2552 | 2571 |
| 2553 // Records a set of feature switches (prefixed with "--"). | 2572 // Records a set of feature switches (prefixed with "--"). |
| 2554 void ReportAboutFlagsHistogramSwitches(const std::string& uma_histogram_name, | 2573 void ReportAboutFlagsHistogramSwitches(const std::string& uma_histogram_name, |
| 2555 const std::set<std::string>& switches) { | 2574 const std::set<std::string>& switches) { |
| 2556 for (const std::string& flag : switches) { | 2575 for (const std::string& flag : switches) { |
| 2557 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId; | 2576 int uma_id = about_flags::testing::kBadSwitchFormatHistogramId; |
| 2558 if (base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) { | 2577 if (base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) { |
| 2559 // Skip '--' before switch name. | 2578 // Skip '--' before switch name. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; | 2705 const base::HistogramBase::Sample kBadSwitchFormatHistogramId = 0; |
| 2687 | 2706 |
| 2688 const FeatureEntry* GetFeatureEntries(size_t* count) { | 2707 const FeatureEntry* GetFeatureEntries(size_t* count) { |
| 2689 *count = arraysize(kFeatureEntries); | 2708 *count = arraysize(kFeatureEntries); |
| 2690 return kFeatureEntries; | 2709 return kFeatureEntries; |
| 2691 } | 2710 } |
| 2692 | 2711 |
| 2693 } // namespace testing | 2712 } // namespace testing |
| 2694 | 2713 |
| 2695 } // namespace about_flags | 2714 } // namespace about_flags |
| OLD | NEW |