Stub out chrome://indexeddb-internals

This is the just the WebUI code necessary to show HTML at the chrome://indexeddb-internals
URL. The page just says "Welcome" to start.

BUG=174188

Review URL: https://chromiumcodereview.appspot.com/13230003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192926 0039d316-1c4b-4281-b951-d872f2087c98
parent 72a23be5
// Copyright (c) 2013 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 "content/browser/indexed_db/indexed_db_internals_ui.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/url_constants.h"
#include "grit/content_resources.h"
namespace content {
IndexedDBInternalsUI::IndexedDBInternalsUI(WebUI* web_ui)
: WebUIController(web_ui) {
WebUIDataSource* source =
WebUIDataSource::Create(chrome::kChromeUIIndexedDBInternalsHost);
source->SetJsonPath("strings.js");
source->AddResourcePath("indexeddb_internals.js",
IDR_INDEXED_DB_INTERNALS_JS);
source->AddResourcePath("indexeddb_internals.css",
IDR_INDEXED_DB_INTERNALS_CSS);
source->SetDefaultResource(IDR_INDEXED_DB_INTERNALS_HTML);
BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
WebUIDataSource::Add(browser_context, source);
}
IndexedDBInternalsUI::~IndexedDBInternalsUI() {
}
}
// Copyright (c) 2013 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.
#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_
#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_
#include "content/public/browser/web_ui_controller.h"
namespace content {
// The implementation for the chrome://indexeddb-internals page.
class IndexedDBInternalsUI : public WebUIController {
public:
explicit IndexedDBInternalsUI(WebUI* web_ui);
virtual ~IndexedDBInternalsUI();
private:
DISALLOW_COPY_AND_ASSIGN(IndexedDBInternalsUI);
};
} // namespace content
#endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_INTERNALS_UI_H_
dgrogan@chromium.org
michaeln@chromium.org
jsbell@chromium.org
alecflett@chromium.org
/* Copyright (c) 2013 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. */
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>IndexedDB Status</title>
<link rel="stylesheet" href="chrome://resources/css/tabs.css">
<link rel="stylesheet" href="chrome://resources/css/widgets.css">
<link rel="stylesheet" href="indexeddb_internals.css">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/load_time_data.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="strings.js"></script>
<script src="indexeddb_internals.js"></script>
</head>
<body>
<h1>IndexedDB Status</h1>
<p id="welcome-message">Welcome.</p>
<script src="chrome://resources/js/i18n_template2.js"></script>
</body>
</html>
// Copyright (c) 2013 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.
cr.define('indexeddb', function() {
'use strict';
function initialize() {
}
return {
initialize: initialize,
};
});
document.addEventListener('DOMContentLoaded', indexeddb.initialize);
......@@ -6,6 +6,7 @@
#include "content/browser/accessibility/accessibility_ui.h"
#include "content/browser/gpu/gpu_internals_ui.h"
#include "content/browser/indexed_db/indexed_db_internals_ui.h"
#include "content/browser/media/media_internals_ui.h"
#include "content/browser/media/webrtc_internals_ui.h"
#include "content/browser/tracing/tracing_ui.h"
......@@ -22,6 +23,7 @@ WebUI::TypeID ContentWebUIControllerFactory::GetWebUIType(
url.host() == chrome::kChromeUITracingHost ||
#endif
url.host() == chrome::kChromeUIGpuHost ||
url.host() == chrome::kChromeUIIndexedDBInternalsHost ||
url.host() == chrome::kChromeUIMediaInternalsHost ||
url.host() == chrome::kChromeUIAccessibilityHost) {
return const_cast<ContentWebUIControllerFactory*>(this);
......@@ -45,6 +47,8 @@ WebUIController* ContentWebUIControllerFactory::CreateWebUIControllerForURL(
return new WebRTCInternalsUI(web_ui);
if (url.host() == chrome::kChromeUIGpuHost)
return new GpuInternalsUI(web_ui);
if (url.host() == chrome::kChromeUIIndexedDBInternalsHost)
return new IndexedDBInternalsUI(web_ui);
if (url.host() == chrome::kChromeUIMediaInternalsHost)
return new MediaInternalsUI(web_ui);
if (url.host() == chrome::kChromeUIAccessibilityHost)
......
......@@ -536,6 +536,8 @@
'browser/in_process_webkit/webkit_thread.h',
'browser/indexed_db/indexed_db_context_impl.cc',
'browser/indexed_db/indexed_db_context_impl.h',
'browser/indexed_db/indexed_db_internals_ui.cc',
'browser/indexed_db/indexed_db_internals_ui.h',
'browser/indexed_db/indexed_db_quota_client.cc',
'browser/indexed_db/indexed_db_quota_client.h',
'browser/loader/async_resource_handler.cc',
......
......@@ -19,6 +19,9 @@
<include name="IDR_GPU_INTERNALS_HTML" file="browser/resources/gpu/gpu_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_GPU_INTERNALS_JS" file="browser/resources/gpu/gpu_internals.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_GPU_SWITCHING_LIST" file="browser/gpu/gpu_switching_list.json" type="BINDATA" />
<include name="IDR_INDEXED_DB_INTERNALS_HTML" file="browser/resources/indexed_db/indexeddb_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INDEXED_DB_INTERNALS_JS" file="browser/resources/indexed_db/indexeddb_internals.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_INDEXED_DB_INTERNALS_CSS" file="browser/resources/indexed_db/indexeddb_internals.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_MEDIA_INTERNALS_HTML" file="browser/resources/media/media_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_MEDIA_INTERNALS_JS" file="browser/resources/media/media_internals.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_WEBRTC_INTERNALS_HTML" file="browser/resources/media/webrtc_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
......
......@@ -33,6 +33,7 @@ const char kViewSourceScheme[] = "view-source";
const char kAboutBlankURL[] = "about:blank";
const char kAboutSrcDocURL[] = "about:srcdoc";
const char kChromeUIAppCacheInternalsHost[] = "appcache-internals";
const char kChromeUIIndexedDBInternalsHost[] = "indexeddb-internals";
const char kChromeUIAccessibilityHost[] = "accessibility";
const char kChromeUIBlobInternalsHost[] = "blob-internals";
const char kChromeUIBrowserCrashHost[] = "inducebrowsercrashforrealz";
......
......@@ -44,6 +44,7 @@ CONTENT_EXPORT extern const char kChromeUIAppCacheInternalsHost[];
CONTENT_EXPORT extern const char kChromeUIBlobInternalsHost[];
CONTENT_EXPORT extern const char kChromeUIBrowserCrashHost[];
CONTENT_EXPORT extern const char kChromeUIHistogramHost[];
CONTENT_EXPORT extern const char kChromeUIIndexedDBInternalsHost[];
CONTENT_EXPORT extern const char kChromeUIMediaInternalsHost[];
CONTENT_EXPORT extern const char kChromeUINetworkViewCacheHost[];
CONTENT_EXPORT extern const char kChromeUIResourcesHost[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment