summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents/navigation_controller.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 23:55:06 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 23:55:06 +0000
commitcd3d789910d9bbd81c2a08eee26bffc4ae10ab52 (patch)
tree2d640336dd883be4f375540ea6573ede6fd3e732 /chrome/browser/tab_contents/navigation_controller.cc
parent90f6e2e8b787268630fcecddd7542e1bfb587ab3 (diff)
downloadchromium_src-cd3d789910d9bbd81c2a08eee26bffc4ae10ab52.zip
chromium_src-cd3d789910d9bbd81c2a08eee26bffc4ae10ab52.tar.gz
chromium_src-cd3d789910d9bbd81c2a08eee26bffc4ae10ab52.tar.bz2
Clean up the browser about URL handler to not derive from WebContents. It is
instead integrated in the BrowserURLHandler for special schemes. This solves a number of problems and cleans things up nicely. Most of the functions were not necessary to have in the header file of the browser about handler, so I made them local to the .cc file. I moved everything around, but there was no change to any of the About...() functions. This improves the about:memory page to not include the memory of the new tab page it replaced. The entry for itself also has the proper title. This works by using a meta refresh to the actual page, the the process transition no longer happens at the same time as the about:memory page computation. This also fixes problems with the about:network and about:ipc dialogs opening blank pages and also re-opening the dialog when you close the browser. Review URL: http://codereview.chromium.org/27238 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/navigation_controller.cc')
-rw-r--r--chrome/browser/tab_contents/navigation_controller.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc
index 374b1804..850a865 100644
--- a/chrome/browser/tab_contents/navigation_controller.cc
+++ b/chrome/browser/tab_contents/navigation_controller.cc
@@ -7,6 +7,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_util.h"
+#include "chrome/browser/browser_about_handler.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/dom_ui/dom_ui_host.h"
#include "chrome/browser/sessions/session_types.h"
@@ -55,7 +56,6 @@ void SetContentStateIfEmpty(NavigationEntry* entry) {
(entry->tab_type() == TAB_CONTENTS_WEB ||
entry->tab_type() == TAB_CONTENTS_NEW_TAB_UI ||
entry->tab_type() == TAB_CONTENTS_DOM_UI ||
- entry->tab_type() == TAB_CONTENTS_ABOUT_UI ||
entry->tab_type() == TAB_CONTENTS_HTML_DIALOG ||
entry->IsViewSourceMode())) {
entry->set_content_state(
@@ -247,6 +247,11 @@ NavigationEntry* NavigationController::GetEntryWithPageID(
}
void NavigationController::LoadEntry(NavigationEntry* entry) {
+ // Handle non-navigational URLs that popup dialogs and such, these should not
+ // actually navigate.
+ if (HandleNonNavigationAboutURL(entry->url()))
+ return;
+
// When navigating to a new page, we don't know for sure if we will actually
// end up leaving the current page. The new page load could for example
// result in a download or a 'no content' response (e.g., a mailto: URL).
@@ -463,17 +468,15 @@ NavigationEntry* NavigationController::CreateNavigationEntry(
// If the active contents supports |url|, use it.
// Note: in both cases, we give TabContents a chance to rewrite the URL.
+ //
+ // TODO(brettw): The BrowserURLHandler::HandleBrowserURL call should just be
+ // moved here from inside TypeForURL once the tab contents types are removed.
TabContents* active = active_contents();
if (active && active->SupportsURL(&real_url))
type = active->type();
else
type = TabContents::TypeForURL(&real_url);
-
- if (url.SchemeIs(chrome::kViewSourceScheme)) {
- // Load the inner URL instead, setting the original URL as the "display".
- real_url = GURL(url.path());
- }
-
+
NavigationEntry* entry = new NavigationEntry(type, NULL, -1, real_url,
referrer,
string16(), transition);