diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 17:47:58 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 17:47:58 +0000 |
commit | 9e4c033c4f88780c47ebf13ab4b9f180bf63df29 (patch) | |
tree | dcea8183f667edf646f7584064a2ca86af573471 /chrome/browser/debugger | |
parent | d7e85c5dd9c2c8dfb38d1e7c6aacb1c3bd0bf590 (diff) | |
download | chromium_src-9e4c033c4f88780c47ebf13ab4b9f180bf63df29.zip chromium_src-9e4c033c4f88780c47ebf13ab4b9f180bf63df29.tar.gz chromium_src-9e4c033c4f88780c47ebf13ab4b9f180bf63df29.tar.bz2 |
Enable history and downloads by default, port NewTabUI from DOMUIHost to DOMUI.
NewTabUI is only included on OS(WIN) because DOMUI doesn't appear to have been ported.
Review URL: http://codereview.chromium.org/28104
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10344 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger')
-rw-r--r-- | chrome/browser/debugger/debugger_contents.cc | 24 | ||||
-rw-r--r-- | chrome/browser/debugger/debugger_contents.h | 17 |
2 files changed, 28 insertions, 13 deletions
diff --git a/chrome/browser/debugger/debugger_contents.cc b/chrome/browser/debugger/debugger_contents.cc index 19565e8..386b5d8 100644 --- a/chrome/browser/debugger/debugger_contents.cc +++ b/chrome/browser/debugger/debugger_contents.cc @@ -19,6 +19,9 @@ #include "grit/debugger_resources.h" +// DebuggerUI is accessible from chrome-ui://inspector. +static const char kDebuggerHost[] = "inspector"; + class DebuggerHTMLSource : public ChromeURLDataManager::DataSource { public: // Creates our datasource and sets our user message to a specific message @@ -86,8 +89,8 @@ class DebuggerHTMLSource : public ChromeURLDataManager::DataSource { class DebuggerHandler : public DOMMessageHandler { public: - explicit DebuggerHandler(DOMUIHost* host) { - host->RegisterMessageCallback("DebuggerHostMessage", + explicit DebuggerHandler(DOMUI* dom_ui) : DOMMessageHandler(dom_ui) { + dom_ui->RegisterMessageCallback("DebuggerHostMessage", NewCallback(this, &DebuggerHandler::HandleDebuggerHostMessage)); } @@ -118,12 +121,11 @@ class DebuggerHandler : public DOMMessageHandler { }; -DebuggerContents::DebuggerContents(Profile* profile, SiteInstance* instance) - : DOMUIHost(profile, instance, NULL) { - set_type(TAB_CONTENTS_DEBUGGER); +DebuggerContents::DebuggerContents(DOMUIContents* contents) + : DOMUI(contents) { } -void DebuggerContents::AttachMessageHandlers() { +void DebuggerContents::Init() { AddMessageHandler(new DebuggerHandler(this)); DebuggerHTMLSource* html_source = new DebuggerHTMLSource(); @@ -135,6 +137,14 @@ void DebuggerContents::AttachMessageHandlers() { // static bool DebuggerContents::IsDebuggerUrl(const GURL& url) { - return (url.SchemeIs("chrome-ui") && url.host() == "inspector"); + return (url.SchemeIs(DOMUIContents::GetScheme().c_str()) && + url.host() == kDebuggerHost); } +// static +GURL DebuggerContents::GetBaseURL() { + std::string url = DOMUIContents::GetScheme(); + url += "://"; + url += kDebuggerHost; + return GURL(url); +} diff --git a/chrome/browser/debugger/debugger_contents.h b/chrome/browser/debugger/debugger_contents.h index af29f6a..69c33fd 100644 --- a/chrome/browser/debugger/debugger_contents.h +++ b/chrome/browser/debugger/debugger_contents.h @@ -7,24 +7,29 @@ #ifndef CHROME_BROWSER_SHELL_DEBUGGER_CONTENTS_H__ #define CHROME_BROWSER_SHELL_DEBUGGER_CONTENTS_H__ -#include "chrome/browser/dom_ui/dom_ui_host.h" +#include "chrome/browser/dom_ui/dom_ui.h" -class DebuggerContents : public DOMUIHost { +class DebuggerContents : public DOMUI { public: - DebuggerContents(Profile* profile, SiteInstance* instance); + DebuggerContents(DOMUIContents* contents); + + // DOMUI Implementation + virtual void Init(); + + // Return the URL for the front page of this UI. + static GURL GetBaseURL(); static bool IsDebuggerUrl(const GURL& url); protected: + DOMUIContents* contents_; + // WebContents overrides: // We override updating history with a no-op so these pages // are not saved to history. virtual void UpdateHistoryForNavigation(const GURL& url, const ViewHostMsg_FrameNavigate_Params& params) { } - // DOMUIHost implementation. - virtual void AttachMessageHandlers(); - DISALLOW_EVIL_CONSTRUCTORS(DebuggerContents); }; |