Commit fe0d673c authored by creis@chromium.org's avatar creis@chromium.org

Remove duplicated code in favor of IsRendererDebugURL.

BUG=none
TEST=chrome://kill and javascript: URLs still work.
R=nasko@chromium.org

Review URL: https://codereview.chromium.org/160743002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250871 0039d316-1c4b-4281-b951-d872f2087c98
parent cfebb479
......@@ -87,10 +87,7 @@ static bool DebugURLHandler(GURL* url, BrowserContext* browser_context) {
}
// Circumvent processing URLs that the renderer process will handle.
return *url == GURL(kChromeUICrashURL) ||
*url == GURL(kChromeUIHangURL) ||
*url == GURL(kChromeUIKillURL) ||
*url == GURL(kChromeUIShorthangURL);
return IsRendererDebugURL(*url);
}
// static
......
......@@ -5,6 +5,7 @@
#include "content/browser/webui/web_ui_controller_factory_registry.h"
#include "base/lazy_instance.h"
#include "content/browser/frame_host/debug_urls.h"
#include "content/public/common/url_constants.h"
#include "url/gurl.h"
......@@ -80,16 +81,11 @@ bool WebUIControllerFactoryRegistry::IsURLAcceptableForWebUI(
BrowserContext* browser_context,
const GURL& url) const {
return UseWebUIForURL(browser_context, url) ||
// javascript: URLs are allowed to run in Web UI pages.
url.SchemeIs(kJavaScriptScheme) ||
// It's possible to load about:blank in a Web UI renderer.
// See http://crbug.com/42547
url.spec() == kAboutBlankURL ||
// Chrome URLs crash, kill, hang, and shorthang are allowed.
url == GURL(kChromeUICrashURL) ||
url == GURL(kChromeUIKillURL) ||
url == GURL(kChromeUIHangURL) ||
url == GURL(kChromeUIShorthangURL);
// javascript: and debug URLs like chrome://kill are allowed.
IsRendererDebugURL(url);
}
WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment