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

Side by Side Diff: chrome/browser/ui/webui/md_history_ui.cc

Issue 2048553002: MD History: Enable by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add helper function Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.h ('k') | chrome/common/chrome_features.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
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
Dan Beam 2016/06/15 02:01:56 nit: // static
tsergeant 2016/06/15 02:39:44 Oops, done.
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
144 // static 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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.h ('k') | chrome/common/chrome_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698