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

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

Issue 2352553002: [MD History] Run MD History on chrome://chrome/history. (Closed)
Patch Set: 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/chrome_web_ui_controller_factory.cc ('k') | no next file » | 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 a9c0ba1d5ae64c8c3f6a4aaa294ad65dfea8e241..6a2ca91c3c01ddf57b6f1040959fcff20564c809 100644
--- a/chrome/browser/ui/webui/md_history_ui.cc
+++ b/chrome/browser/ui/webui/md_history_ui.cc
@@ -36,7 +36,7 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
PrefService* prefs = profile->GetPrefs();
content::WebUIDataSource* source =
- content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost);
+ content::WebUIDataSource::Create(chrome::kChromeUIUberHost);
// Localized strings (alphabetical order).
source->AddLocalizedString("bookmarked", IDS_HISTORY_ENTRY_BOOKMARKED);
@@ -110,80 +110,86 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile) {
source->AddBoolean("allowDeletingHistory", allow_deleting_history);
bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kHistoryEnableGroupByDomain) || profile->IsSupervised();
+ switches::kHistoryEnableGroupByDomain) ||
+ profile->IsSupervised();
source->AddBoolean("groupByDomain", group_by_domain);
source->AddBoolean("isGuestSession", profile->IsGuestSession());
SigninManagerBase* signin_manager =
SigninManagerFactory::GetForProfile(profile);
- bool is_authenticated = signin_manager != nullptr &&
- signin_manager->IsAuthenticated();
+ bool is_authenticated =
+ signin_manager != nullptr && signin_manager->IsAuthenticated();
source->AddBoolean("isUserSignedIn", is_authenticated);
- source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML);
- source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS);
- source->AddResourcePath("images/100/sign_in_promo.png",
+ source->AddResourcePath("history/constants.html",
+ IDR_MD_HISTORY_CONSTANTS_HTML);
+ source->AddResourcePath("history/constants.js", IDR_MD_HISTORY_CONSTANTS_JS);
+ source->AddResourcePath("history/images/100/sign_in_promo.png",
IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_PNG);
- source->AddResourcePath("images/200/sign_in_promo.png",
+ source->AddResourcePath("history/images/200/sign_in_promo.png",
IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_PNG);
- source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS);
+ source->AddResourcePath("history/history.js", IDR_MD_HISTORY_HISTORY_JS);
#if BUILDFLAG(USE_VULCANIZE)
- source->AddResourcePath("app.html",
+ source->AddResourcePath("history/app.html",
IDR_MD_HISTORY_APP_VULCANIZED_HTML);
- source->AddResourcePath("app.crisper.js",
+ source->AddResourcePath("history/app.crisper.js",
IDR_MD_HISTORY_APP_CRISPER_JS);
#else
- source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML);
- source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS);
- source->AddResourcePath("browser_service.html",
+ source->AddResourcePath("history/app.html", IDR_MD_HISTORY_APP_HTML);
+ source->AddResourcePath("history/app.js", IDR_MD_HISTORY_APP_JS);
+ source->AddResourcePath("history/browser_service.html",
IDR_MD_HISTORY_BROWSER_SERVICE_HTML);
- source->AddResourcePath("browser_service.js",
+ source->AddResourcePath("history/browser_service.js",
IDR_MD_HISTORY_BROWSER_SERVICE_JS);
- source->AddResourcePath("grouped_list.html",
+ source->AddResourcePath("history/grouped_list.html",
IDR_MD_HISTORY_GROUPED_LIST_HTML);
- source->AddResourcePath("grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS);
- source->AddResourcePath("history_item.html",
+ source->AddResourcePath("history/grouped_list.js",
+ IDR_MD_HISTORY_GROUPED_LIST_JS);
+ source->AddResourcePath("history/history_item.html",
IDR_MD_HISTORY_HISTORY_ITEM_HTML);
- source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS);
- source->AddResourcePath("history_list.html",
+ source->AddResourcePath("history/history_item.js",
+ IDR_MD_HISTORY_HISTORY_ITEM_JS);
+ source->AddResourcePath("history/history_list.html",
IDR_MD_HISTORY_HISTORY_LIST_HTML);
- source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS);
- source->AddResourcePath("history_list_behavior.html",
+ source->AddResourcePath("history/history_list.js",
+ IDR_MD_HISTORY_HISTORY_LIST_JS);
+ source->AddResourcePath("history/history_list_behavior.html",
IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML);
- source->AddResourcePath("history_list_behavior.js",
+ source->AddResourcePath("history/history_list_behavior.js",
IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS);
- source->AddResourcePath("history_toolbar.html",
+ source->AddResourcePath("history/history_toolbar.html",
IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML);
- source->AddResourcePath("history_toolbar.js",
+ source->AddResourcePath("history/history_toolbar.js",
IDR_MD_HISTORY_HISTORY_TOOLBAR_JS);
- source->AddResourcePath("icons.html", IDR_MD_HISTORY_ICONS_HTML);
- source->AddResourcePath("lazy_render.html",
+ source->AddResourcePath("history/icons.html", IDR_MD_HISTORY_ICONS_HTML);
+ source->AddResourcePath("history/lazy_render.html",
IDR_MD_HISTORY_LAZY_RENDER_HTML);
- source->AddResourcePath("lazy_render.js",
+ source->AddResourcePath("history/lazy_render.js",
IDR_MD_HISTORY_LAZY_RENDER_JS);
- source->AddResourcePath("list_container.html",
+ source->AddResourcePath("history/list_container.html",
IDR_MD_HISTORY_LIST_CONTAINER_HTML);
- source->AddResourcePath("list_container.js",
+ source->AddResourcePath("history/list_container.js",
IDR_MD_HISTORY_LIST_CONTAINER_JS);
- source->AddResourcePath("searched_label.html",
+ source->AddResourcePath("history/searched_label.html",
IDR_MD_HISTORY_SEARCHED_LABEL_HTML);
- source->AddResourcePath("searched_label.js",
+ source->AddResourcePath("history/searched_label.js",
IDR_MD_HISTORY_SEARCHED_LABEL_JS);
- source->AddResourcePath("shared_style.html",
+ source->AddResourcePath("history/shared_style.html",
IDR_MD_HISTORY_SHARED_STYLE_HTML);
- source->AddResourcePath("shared_vars.html",
+ source->AddResourcePath("history/shared_vars.html",
IDR_MD_HISTORY_SHARED_VARS_HTML);
- source->AddResourcePath("side_bar.html", IDR_MD_HISTORY_SIDE_BAR_HTML);
- source->AddResourcePath("side_bar.js", IDR_MD_HISTORY_SIDE_BAR_JS);
- source->AddResourcePath("synced_device_card.html",
+ source->AddResourcePath("history/side_bar.html",
+ IDR_MD_HISTORY_SIDE_BAR_HTML);
+ source->AddResourcePath("history/side_bar.js", IDR_MD_HISTORY_SIDE_BAR_JS);
+ source->AddResourcePath("history/synced_device_card.html",
IDR_MD_HISTORY_SYNCED_DEVICE_CARD_HTML);
- source->AddResourcePath("synced_device_card.js",
+ source->AddResourcePath("history/synced_device_card.js",
IDR_MD_HISTORY_SYNCED_DEVICE_CARD_JS);
- source->AddResourcePath("synced_device_manager.html",
+ source->AddResourcePath("history/synced_device_manager.html",
IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_HTML);
- source->AddResourcePath("synced_device_manager.js",
+ source->AddResourcePath("history/synced_device_manager.js",
IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_JS);
#endif // BUILDFLAG(USE_VULCANIZE)
@@ -212,10 +218,12 @@ MdHistoryUI::~MdHistoryUI() {}
// static
bool MdHistoryUI::IsEnabled(Profile* profile) {
+ if (profile && profile->IsSupervised())
+ return false;
+
return base::FeatureList::IsEnabled(features::kMaterialDesignHistory) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kHistoryEnableGroupByDomain) &&
- !profile->IsSupervised();
+ switches::kHistoryEnableGroupByDomain);
}
// static
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698