| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/webui/downloads_util.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "base/metrics/field_trial.h" | |
| 9 #include "base/strings/string_util.h" | |
| 10 #include "chrome/common/channel_info.h" | |
| 11 #include "chrome/common/chrome_switches.h" | |
| 12 #include "components/version_info/version_info.h" | |
| 13 | |
| 14 const char kMaterialDesignDownloadsFinchTrialName[] = "MaterialDesignDownloads"; | |
| 15 | |
| 16 bool MdDownloadsEnabled() { | |
| 17 // Intentionally call this before checking command line to assign a group. | |
| 18 std::string group = base::FieldTrialList::FindFullName( | |
| 19 kMaterialDesignDownloadsFinchTrialName); | |
| 20 | |
| 21 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | |
| 22 if (cl->HasSwitch(switches::kEnableMaterialDesignDownloads)) | |
| 23 return true; | |
| 24 | |
| 25 if (cl->HasSwitch(switches::kDisableMaterialDesignDownloads)) | |
| 26 return false; | |
| 27 | |
| 28 return base::StartsWith(group, "Enabled", | |
| 29 base::CompareCase::INSENSITIVE_ASCII); | |
| 30 } | |
| OLD | NEW |