From b689fce776a394377fed51ae063942509a2988a1 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Tue, 17 Mar 2009 22:45:34 +0000 Subject: Merge DOMUIContents into WebContents. I did a lot of cleanup of the DOM UI system as part of this. Review URL: http://codereview.chromium.org/42227 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11925 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_url_handler.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'chrome/browser/browser_url_handler.cc') diff --git a/chrome/browser/browser_url_handler.cc b/chrome/browser/browser_url_handler.cc index 88cb0e2..4da1daf 100644 --- a/chrome/browser/browser_url_handler.cc +++ b/chrome/browser/browser_url_handler.cc @@ -6,8 +6,9 @@ #include "base/string_util.h" #include "chrome/browser/browser_about_handler.h" -#include "chrome/browser/dom_ui/dom_ui_contents.h" +#include "chrome/browser/dom_ui/dom_ui_factory.h" #include "chrome/common/url_constants.h" +#include "googleurl/src/gurl.h" // Handles rewriting view-source URLs for what we'll actually load. static bool HandleViewSource(GURL* url, TabContentsType* type) { @@ -20,6 +21,15 @@ static bool HandleViewSource(GURL* url, TabContentsType* type) { return false; } +// Handles URLs for DOM UI. These URLs need no rewriting. +static bool HandleDOMUI(GURL* url, TabContentsType* type) { + if (!DOMUIFactory::UseDOMUIForURL(*url)) + return false; + + *type = TAB_CONTENTS_WEB; + return true; +} + std::vector BrowserURLHandler::url_handlers_; // static @@ -29,7 +39,7 @@ void BrowserURLHandler::InitURLHandlers() { // Add the default URL handlers. url_handlers_.push_back(&WillHandleBrowserAboutURL); // about: - url_handlers_.push_back(&DOMUIContentsCanHandleURL); // chrome-ui: + url_handlers_.push_back(&HandleDOMUI); // chrome-ui: & friends. url_handlers_.push_back(&HandleViewSource); // view-source: } -- cgit v1.1