Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: chrome/browser/debugger/debugger_contents.cc

Issue 28104: Enable history and downloads by default, port NewTabUI from DOMUIHost to DOMU... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/debugger/debugger_contents.h ('k') | chrome/browser/dom_ui/dom_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/debugger/debugger_contents.cc
===================================================================
--- chrome/browser/debugger/debugger_contents.cc (revision 10343)
+++ chrome/browser/debugger/debugger_contents.cc (working copy)
@@ -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 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 @@
};
-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 @@
// 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);
+}
« no previous file with comments | « chrome/browser/debugger/debugger_contents.h ('k') | chrome/browser/dom_ui/dom_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698