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

Unified Diff: chrome/browser/ui/webui/settings/md_settings_ui.cc

Issue 2076083003: MD Settings: ... and we fixed all CHECK()-based URL crashes once and for all. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: !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
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 b0b68764351090b08af0a51022d231f1f51b6c21..0cf77325aa5372e5f4fcdb74467fc60e5c5e2c17 100644
--- a/chrome/browser/ui/webui/settings/md_settings_ui.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -53,7 +53,7 @@
namespace settings {
-MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
+MdSettingsUI::MdSettingsUI(content::WebUI* web_ui, const GURL& url)
: content::WebUIController(web_ui),
WebContentsObserver(web_ui->GetWebContents()) {
Profile* profile = Profile::FromWebUI(web_ui);
@@ -88,11 +88,6 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
// Host must be derived from the visible URL, since this might be serving
// either chrome://settings or chrome://md-settings.
- GURL url = web_ui->GetWebContents()->GetVisibleURL();
-
- if (url.SchemeIs(content::kViewSourceScheme))
- url = GURL(url.GetContent());
-
CHECK(url.GetOrigin() == GURL(chrome::kChromeUISettingsURL).GetOrigin() ||
url.GetOrigin() == GURL(chrome::kChromeUIMdSettingsURL).GetOrigin());
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_ui.h ('k') | chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698