summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 09:45:02 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-24 09:45:02 +0000
commit58bfc6b074bf05e36f02a4349a6217b95f3b9c2c (patch)
tree2b2c7efa3330c70ef019a539481595e38f6f6347 /chrome/browser/dom_ui
parentea36e32155bfe33d4cad2fbfeffc54edc7de1cb3 (diff)
downloadchromium_src-58bfc6b074bf05e36f02a4349a6217b95f3b9c2c.zip
chromium_src-58bfc6b074bf05e36f02a4349a6217b95f3b9c2c.tar.gz
chromium_src-58bfc6b074bf05e36f02a4349a6217b95f3b9c2c.tar.bz2
DevTools: Nuke legacy debugger.
Review URL: http://codereview.chromium.org/146027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/debugger_ui.cc134
-rw-r--r--chrome/browser/dom_ui/debugger_ui.h20
-rw-r--r--chrome/browser/dom_ui/dom_ui_factory.cc7
3 files changed, 0 insertions, 161 deletions
diff --git a/chrome/browser/dom_ui/debugger_ui.cc b/chrome/browser/dom_ui/debugger_ui.cc
deleted file mode 100644
index fd29146..0000000
--- a/chrome/browser/dom_ui/debugger_ui.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/dom_ui/debugger_ui.h"
-
-#include "app/resource_bundle.h"
-#include "base/command_line.h"
-#include "base/file_util.h"
-#include "base/message_loop.h"
-#include "base/string_util.h"
-#include "base/thread.h"
-#include "base/values.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/debugger/debugger_shell.h"
-#include "chrome/browser/debugger/debugger_wrapper.h"
-#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/url_constants.h"
-#include "net/base/mime_util.h"
-
-#include "grit/debugger_resources.h"
-
-namespace {
-
-class DebuggerHTMLSource : public ChromeURLDataManager::DataSource {
- public:
- // Creates our datasource and sets our user message to a specific message
- // from our string bundle.
- DebuggerHTMLSource()
- : DataSource("debugger", MessageLoop::current()) { }
-
- // Called when the network layer has requested a resource underneath
- // the path we registered.
- virtual void StartDataRequest(const std::string& path, int request_id) {
- int resource_id = 0;
-
- if (!path.length()) {
- resource_id = IDR_DEBUGGER_HTML;
- } else if (path == "debugger.js") {
- resource_id = IDR_DEBUGGER_JS;
- } else if (path == "debugger.css") {
- resource_id = IDR_DEBUGGER_CSS;
- } else {
- SendResponse(request_id, NULL);
- return;
- }
-
- std::wstring debugger_path =
- CommandLine::ForCurrentProcess()->GetSwitchValue(
- switches::kJavaScriptDebuggerPath);
- std::string data_str;
- if (!debugger_path.empty() && file_util::PathExists(debugger_path)) {
- if (path.empty())
- file_util::AppendToPath(&debugger_path, L"debugger.html");
- else
- file_util::AppendToPath(&debugger_path, UTF8ToWide(path));
- if (!file_util::ReadFileToString(debugger_path, &data_str)) {
- SendResponse(request_id, NULL);
- return;
- }
- } else {
- ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- data_str = rb.GetDataResource(resource_id);
- }
- scoped_refptr<RefCountedBytes> data_bytes(new RefCountedBytes);
- data_bytes->data.resize(data_str.size());
- std::copy(data_str.begin(), data_str.end(), data_bytes->data.begin());
-
- SendResponse(request_id, data_bytes);
- }
-
- virtual std::string GetMimeType(const std::string& path) const {
- // Currently but three choices {"", "debugger.js", "debugger.css"}.
- // Map the extension to mime-type, defaulting to "text/html".
- std::string mime_type("text/html");
-#if defined(OS_WIN)
- FilePath file_path(ASCIIToWide(path));
-#elif defined(OS_POSIX)
- FilePath file_path(path);
-#endif
- net::GetMimeTypeFromFile(file_path, &mime_type);
- return mime_type;
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DebuggerHTMLSource);
-};
-
-
-class DebuggerHandler : public DOMMessageHandler {
- public:
- explicit DebuggerHandler(DOMUI* dom_ui) : DOMMessageHandler(dom_ui) {
- dom_ui->RegisterMessageCallback("DebuggerHostMessage",
- NewCallback(this, &DebuggerHandler::HandleDebuggerHostMessage));
- }
-
- void HandleDebuggerHostMessage(const Value* content) {
- if (!content || !content->IsType(Value::TYPE_LIST)) {
- NOTREACHED();
- return;
- }
- const ListValue* args = static_cast<const ListValue*>(content);
- if (args->GetSize() < 1) {
- NOTREACHED();
- return;
- }
-
-#ifndef CHROME_DEBUGGER_DISABLED
- DebuggerWrapper* wrapper = g_browser_process->debugger_wrapper();
- DebuggerHost* debugger_host = wrapper->GetDebugger();
- if (!debugger_host) {
- NOTREACHED();
- return;
- }
- debugger_host->OnDebuggerHostMsg(args);
-#endif
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DebuggerHandler);
-};
-
-} // namespace
-
-DebuggerUI::DebuggerUI(TabContents* contents) : DOMUI(contents) {
- AddMessageHandler(new DebuggerHandler(this));
-
- DebuggerHTMLSource* html_source = new DebuggerHTMLSource();
- g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(&chrome_url_data_manager,
- &ChromeURLDataManager::AddDataSource,
- html_source));
-}
diff --git a/chrome/browser/dom_ui/debugger_ui.h b/chrome/browser/dom_ui/debugger_ui.h
deleted file mode 100644
index f64fc36..0000000
--- a/chrome/browser/dom_ui/debugger_ui.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// This file defines utility functions for working with strings.
-
-#ifndef CHROME_BROWSER_DOM_UI_DEBUGGER_UI_H_
-#define CHROME_BROWSER_DOM_UI_DEBUGGER_UI_H_
-
-#include "chrome/browser/dom_ui/dom_ui.h"
-
-class DebuggerUI : public DOMUI {
- public:
- DebuggerUI(TabContents* contents);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DebuggerUI);
-};
-
-#endif // CHROME_BROWSER_DOM_UI_DEBUGGER_UI_H_
diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc
index c2dea2d..c5576cf 100644
--- a/chrome/browser/dom_ui/dom_ui_factory.cc
+++ b/chrome/browser/dom_ui/dom_ui_factory.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/dom_ui/dom_ui_factory.h"
#include "chrome/browser/dom_ui/downloads_ui.h"
-#include "chrome/browser/dom_ui/debugger_ui.h"
#include "chrome/browser/dom_ui/devtools_ui.h"
#include "chrome/browser/dom_ui/history_ui.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
@@ -80,12 +79,6 @@ static bool CreateDOMUI(const GURL& url, TabContents* tab_contents,
return true;
}
- if (url.host() == chrome::kChromeUIInspectorHost) {
- if (new_ui)
- *new_ui = new DebuggerUI(tab_contents);
- return true;
- }
-
if (url.host() == chrome::kChromeUIDevToolsHost) {
if (new_ui)
*new_ui = new DevToolsUI(tab_contents);