OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/ui/webui/downloads_util.h" | 5 #include "chrome/browser/ui/webui/downloads_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/channel_info.h" | 8 #include "chrome/common/channel_info.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "components/version_info/version_info.h" | 10 #include "components/version_info/version_info.h" |
11 | 11 |
12 bool MdDownloadsEnabled() { | 12 bool MdDownloadsEnabled() { |
13 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); | 13 base::CommandLine* cl = base::CommandLine::ForCurrentProcess(); |
14 | 14 |
15 if (cl->HasSwitch(switches::kEnableMaterialDesignDownloads)) | 15 if (cl->HasSwitch(switches::kEnableMaterialDesignDownloads)) |
16 return true; | 16 return true; |
17 | 17 |
18 if (cl->HasSwitch(switches::kDisableMaterialDesignDownloads)) | 18 if (cl->HasSwitch(switches::kDisableMaterialDesignDownloads)) |
19 return false; | 19 return false; |
20 | 20 |
21 switch (chrome::GetChannel()) { | 21 switch (chrome::GetChannel()) { |
22 case version_info::Channel::CANARY: | 22 case version_info::Channel::CANARY: |
23 case version_info::Channel::UNKNOWN: | 23 case version_info::Channel::UNKNOWN: |
24 return false; // TODO(dbeam): return true when I update the tests. | 24 return true; |
25 default: | 25 default: |
26 return false; | 26 return false; |
27 } | 27 } |
28 } | 28 } |
OLD | NEW |