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

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: more !android 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
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.h ('k') | chrome/browser/ui/webui/uber/uber_ui_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 060910c06e61328d6c124a87489c010130462b18..4f01d93968cfabadd6a4c329b4d47274adc381b9 100644
--- a/chrome/browser/ui/webui/md_history_ui.cc
+++ b/chrome/browser/ui/webui/md_history_ui.cc
@@ -215,10 +215,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));
}
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.h ('k') | chrome/browser/ui/webui/uber/uber_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698