Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: chrome/browser/ui/webui/md_history_ui.cc

Issue 2318643003: MD History: truncate title to 300 chars in C++ instead of JS (Closed)
Patch Set: !android in tests as well Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/md_history_ui.cc
diff --git a/chrome/browser/ui/webui/md_history_ui.cc b/chrome/browser/ui/webui/md_history_ui.cc
index 31c5ceceaf249d4f8c7a9b74212498118c076fd9..671f0ecc17e1518fee21ac0ab9aecbab973acdf2 100644
--- a/chrome/browser/ui/webui/md_history_ui.cc
+++ b/chrome/browser/ui/webui/md_history_ui.cc
@@ -213,10 +213,12 @@ bool MdHistoryUI::IsEnabled(Profile* profile) {
}
// static
-void MdHistoryUI::DisableForTesting() {
+void MdHistoryUI::SetEnabledForTesting(bool enabled) {
std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
- feature_list->InitializeFromCommandLine(
- std::string(), features::kMaterialDesignHistory.name);
+
+ const std::string& name = features::kMaterialDesignHistory.name;
+ feature_list->InitializeFromCommandLine(enabled ? name : "",
+ enabled ? "" : name);
base::FeatureList::ClearInstanceForTesting();
base::FeatureList::SetInstance(std::move(feature_list));
}

Powered by Google App Engine
This is Rietveld 408576698