summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_about_handler.h
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/browser_about_handler.h
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/browser_about_handler.h')
-rw-r--r--chrome/browser/browser_about_handler.h79
1 files changed, 12 insertions, 67 deletions
diff --git a/chrome/browser/browser_about_handler.h b/chrome/browser/browser_about_handler.h
index 21ffb27..abad2aa1 100644
--- a/chrome/browser/browser_about_handler.h
+++ b/chrome/browser/browser_about_handler.h
@@ -7,76 +7,21 @@
#ifndef CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_
#define CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_
-#include <string>
-
-#include "base/basictypes.h"
#include "chrome/browser/tab_contents/tab_contents_type.h"
-#include "chrome/browser/tab_contents/web_contents.h"
-#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
-class AboutSource;
-class DictionaryValue;
class GURL;
-class ListValue;
-class Profile;
-class RenderProcessHost;
-class RenderViewHostFactory;
-class SiteInstance;
-
-class BrowserAboutHandler : public WebContents {
- public:
- BrowserAboutHandler(Profile* profile,
- SiteInstance* instance,
- RenderViewHostFactory* render_view_factory);
- virtual ~BrowserAboutHandler() {}
-
- // We don't want a favicon on the about pages.
- virtual bool ShouldDisplayFavIcon() { return false; }
- // Enable javascript urls for the about pages.
- virtual bool SupportsURL(GURL* url);
-
- // If |url| is a known "about:" URL, this method handles it
- // and sets |url| to an alternate URL indicating the real content to load.
- // (If it's not a URL that the function can handle, it's a no-op and returns
- // false.)
- static bool MaybeHandle(GURL* url, TabContentsType* type);
-
- // Renders a special page for "about:" which displays version information.
- static std::string AboutVersion();
-
- // Renders a special page for about:plugins.
- static std::string AboutPlugins();
-
- // Renders a special page for about:histograms.
- static std::string AboutHistograms(const std::string& query);
-
- // Renders a special page about:objects (about tracked objects such as Tasks).
- static std::string AboutObjects(const std::string& query);
-
- // Renders a special page for about:dns.
- static std::string AboutDns();
-
- // Renders a special page for about:stats.
- static std::string AboutStats();
-
- // Renders a special page for "about:credits" which displays our
- // acknowledgements and legal information for code we depend on.
- static std::string AboutCredits();
-
- // Renders a special page for "about:terms" which displays our
- // terms and conditions.
- static std::string AboutTerms();
-
- // Renders a special page for about:memory which displays
- // information about current state.
- static void AboutMemory(AboutSource*, int request_id);
-
- // This displays the Linux splash screen for development releases.
- static std::string AboutLinuxSplash();
- private:
- ChromeURLDataManager::DataSource* about_source_;
- DISALLOW_COPY_AND_ASSIGN(BrowserAboutHandler);
-};
+// Decides whether the given URL will be handled by the browser about handler
+// and returns true if so. On true, it may also modify the given URL to be the
+// final form (we fix up most "about:" URLs to be "chrome-ui:" because WebKit
+// handles all "about:" URLs as "about:blank.
+//
+// This is used by BrowserURLHandler.
+bool WillHandleBrowserAboutURL(GURL* url, TabContentsType* type);
+
+// We have a few magic commands that don't cause navigations, but rather pop up
+// dialogs. This function handles those cases, and returns true if so. In this
+// case, normal tab navigation should be skipped.
+bool HandleNonNavigationAboutURL(const GURL& url);
#endif // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_