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

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

Issue 2034473003: [MD History] Disable MD History for supervised users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hide_search_bar
Patch Set: fix android 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 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.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 e73b50ef626118d9bda1ecb351e4e82479e2c0b6..098c42da230a8be0f32b594f2513dcebcf5835fb 100644
--- a/chrome/browser/ui/webui/md_history_ui.cc
+++ b/chrome/browser/ui/webui/md_history_ui.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/ui/webui/foreign_session_handler.h"
#include "chrome/browser/ui/webui/history_login_handler.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -69,7 +70,7 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
source->AddBoolean("allowDeletingHistory", allow_deleting_history);
bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kHistoryEnableGroupByDomain);
+ switches::kHistoryEnableGroupByDomain) || profile->IsSupervised();
source->AddBoolean("groupByDomain", group_by_domain);
source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
@@ -131,6 +132,16 @@ MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
MdHistoryUI::~MdHistoryUI() {}
+// static
+bool MdHistoryUI::IsEnabled(Profile* profile) {
+ return base::FeatureList::IsEnabled(
+ features::kMaterialDesignHistoryFeature) &&
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kHistoryEnableGroupByDomain) &&
+ !profile->IsSupervised();
+}
+
+// static
base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes(
ui::ScaleFactor scale_factor) {
return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
« no previous file with comments | « chrome/browser/ui/webui/md_history_ui.h ('k') | chrome/browser/ui/webui/uber/uber_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698