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

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

Issue 2166693002: [MD Settings] PROOF OF CONCEPT - DO NOT LAND - URL rewrite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use existing hooks Created 4 years, 5 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
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/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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.cc ('k') | components/sessions/content/content_serialized_navigation_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698