Chromium Code Reviews| Index: chrome/browser/ui/webui/settings/md_settings_ui.cc |
| diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc |
| index b2ddfdec737bb9f02687f965084f2af28bc433ea..15108d04a6f8bd508a24ad5b0c7db3da07917884 100644 |
| --- a/chrome/browser/ui/webui/settings/md_settings_ui.cc |
| +++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc |
| @@ -8,6 +8,7 @@ |
| #include <string> |
| +#include "base/feature_list.h" |
| #include "base/metrics/histogram_macros.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/webui/settings/about_handler.h" |
| @@ -24,6 +25,7 @@ |
| #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| #include "chrome/browser/ui/webui/settings/settings_startup_pages_handler.h" |
| #include "chrome/browser/ui/webui/settings/site_settings_handler.h" |
| +#include "chrome/common/chrome_features.h" |
| #include "chrome/common/url_constants.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/browser/web_ui.h" |
| @@ -80,8 +82,10 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui) |
| AddSettingsPageUIHandler(new SystemHandler()); |
| #endif |
| - content::WebUIDataSource* html_source = |
| - content::WebUIDataSource::Create(chrome::kChromeUIMdSettingsHost); |
| + // Host must be derived from the visible URL, since this might be serving |
| + // either chrome://settings or chrome://md-settings. |
|
Dan Beam
2016/06/03 03:01:43
if you're worried about it,
const GURL url = web_
groby-ooo-7-16
2016/06/06 20:11:59
Done. And given that this is a possible privilege
|
| + content::WebUIDataSource* html_source = content::WebUIDataSource::Create( |
| + web_ui->GetWebContents()->GetVisibleURL().host()); |
| #if defined(OS_CHROMEOS) |
| chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler = |