| 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/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 MdHistoryUI::~MdHistoryUI() {} | 183 MdHistoryUI::~MdHistoryUI() {} |
| 184 | 184 |
| 185 // static | 185 // static |
| 186 bool MdHistoryUI::IsEnabled(Profile* profile) { | 186 bool MdHistoryUI::IsEnabled(Profile* profile) { |
| 187 return base::FeatureList::IsEnabled( | 187 return base::FeatureList::IsEnabled( |
| 188 features::kMaterialDesignHistoryFeature) && | 188 features::kMaterialDesignHistoryFeature) && |
| 189 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 189 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 190 switches::kHistoryEnableGroupByDomain) && | 190 switches::kHistoryEnableGroupByDomain) && |
| 191 !profile->IsSupervised(); | 191 profile && !profile->IsSupervised(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 // static | 194 // static |
| 195 void MdHistoryUI::DisableForTesting() { | 195 void MdHistoryUI::DisableForTesting() { |
| 196 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | 196 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 197 feature_list->InitializeFromCommandLine( | 197 feature_list->InitializeFromCommandLine( |
| 198 std::string(), features::kMaterialDesignHistoryFeature.name); | 198 std::string(), features::kMaterialDesignHistoryFeature.name); |
| 199 base::FeatureList::ClearInstanceForTesting(); | 199 base::FeatureList::ClearInstanceForTesting(); |
| 200 base::FeatureList::SetInstance(std::move(feature_list)); | 200 base::FeatureList::SetInstance(std::move(feature_list)); |
| 201 } | 201 } |
| 202 | 202 |
| 203 // static | 203 // static |
| 204 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( | 204 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( |
| 205 ui::ScaleFactor scale_factor) { | 205 ui::ScaleFactor scale_factor) { |
| 206 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 206 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 207 IDR_HISTORY_FAVICON, scale_factor); | 207 IDR_HISTORY_FAVICON, scale_factor); |
| 208 } | 208 } |
| OLD | NEW |