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/md_history_ui.h" | 5 #include "chrome/browser/ui/webui/md_history_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/webui/browsing_history_handler.h" | 10 #include "chrome/browser/ui/webui/browsing_history_handler.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // static | 135 // static |
136 bool MdHistoryUI::IsEnabled(Profile* profile) { | 136 bool MdHistoryUI::IsEnabled(Profile* profile) { |
137 return base::FeatureList::IsEnabled( | 137 return base::FeatureList::IsEnabled( |
138 features::kMaterialDesignHistoryFeature) && | 138 features::kMaterialDesignHistoryFeature) && |
139 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 139 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
140 switches::kHistoryEnableGroupByDomain) && | 140 switches::kHistoryEnableGroupByDomain) && |
141 !profile->IsSupervised(); | 141 !profile->IsSupervised(); |
142 } | 142 } |
143 | 143 |
144 // static | 144 // static |
| 145 void MdHistoryUI::DisableForTesting() { |
| 146 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 147 feature_list->InitializeFromCommandLine( |
| 148 std::string(), features::kMaterialDesignHistoryFeature.name); |
| 149 base::FeatureList::ClearInstanceForTesting(); |
| 150 base::FeatureList::SetInstance(std::move(feature_list)); |
| 151 } |
| 152 |
| 153 // static |
145 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( | 154 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( |
146 ui::ScaleFactor scale_factor) { | 155 ui::ScaleFactor scale_factor) { |
147 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 156 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
148 IDR_HISTORY_FAVICON, scale_factor); | 157 IDR_HISTORY_FAVICON, scale_factor); |
149 } | 158 } |
OLD | NEW |