summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 06:36:19 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-24 06:36:19 +0000
commitcd8c905857cb134f7c884389dd5652731b30d51e (patch)
tree7d270fe59a56df7254ed38eea7feacfc2b2f35cf
parent7ad0dea94b930fdfaf3fb3de212c7321267156c8 (diff)
downloadchromium_src-cd8c905857cb134f7c884389dd5652731b30d51e.zip
chromium_src-cd8c905857cb134f7c884389dd5652731b30d51e.tar.gz
chromium_src-cd8c905857cb134f7c884389dd5652731b30d51e.tar.bz2
Replace about:plugins page with new page.
Do this by "remapping" about:plugins to chrome://plugins/. Also delete old about:plugins page and associated strings. BUG=736 TEST=Go to about:plugins; should get new plugins page (same as chrome://plugins/). Review URL: http://codereview.chromium.org/1219005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42434 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd32
-rw-r--r--chrome/browser/browser_about_handler.cc45
-rw-r--r--chrome/browser/browser_resources.grd1
-rw-r--r--chrome/browser/resources/about_plugins.html205
-rw-r--r--chrome/common/url_constants.cc3
-rw-r--r--chrome/common/url_constants.h3
6 files changed, 11 insertions, 278 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 1cd756c..d72ffc2 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -3507,38 +3507,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
- <!-- about:plugins strings -->
- <message name="IDS_ABOUT_PLUGINS_TITLE" desc="Title on the about:plugins page">
- About Plug-ins
- </message>
- <message name="IDS_ABOUT_PLUGINS_HEADING_PLUGS" desc="about:plugins page heading if the user has at least one plugin installed">
- Installed plug-ins
- </message>
- <message name="IDS_ABOUT_PLUGINS_HEADING_NOPLUGS" desc="about:plugins page heading if the user has no plugins installed">
- No plug-ins are installed
- </message>
- <message name="IDS_ABOUT_PLUGINS_FILENAME_LABEL" desc="about:plugins file name label">
- File name:
- </message>
- <message name="IDS_ABOUT_PLUGINS_MIMETYPE_LABEL" desc="about:plugins mime type table heading">
- MIME Type
- </message>
- <message name="IDS_ABOUT_PLUGINS_DESCRIPTION_LABEL" desc="about:plugins description table heading">
- Description
- </message>
- <message name="IDS_ABOUT_PLUGINS_SUFFIX_LABEL" desc="about:plugins suffix table heading">
- Suffixes
- </message>
- <message name="IDS_ABOUT_PLUGINS_ENABLED_LABEL" desc="about:plugins enabled table heading">
- Enabled
- </message>
- <message name="IDS_ABOUT_PLUGINS_ENABLED_YES" desc="about:plugins enabled label">
- Yes
- </message>
- <message name="IDS_ABOUT_PLUGINS_ENABLED_NO" desc="about:plugins not enabled label">
- No
- </message>
-
<!-- about:version strings -->
<message name="IDS_ABOUT_VERSION_TITLE" desc="Title on the about:version page">
About Version
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index a4126d1..91be7c2 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -85,7 +85,6 @@ const char kDnsPath[] = "dns";
const char kHistogramsPath[] = "histograms";
const char kMemoryRedirectPath[] = "memory-redirect";
const char kMemoryPath[] = "memory";
-const char kPluginsPath[] = "plugins";
const char kStatsPath[] = "stats";
const char kSyncPath[] = "sync";
const char kTasksPath[] = "tasks";
@@ -335,40 +334,6 @@ static std::string AboutObjects(const std::string& query) {
}
#endif // TRACK_ALL_TASK_OBJECTS
-std::string AboutPlugins() {
- // Strings used in the JsTemplate file.
- DictionaryValue localized_strings;
- localized_strings.SetString(L"title",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_TITLE));
- localized_strings.SetString(L"headingPlugs",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_HEADING_PLUGS));
- localized_strings.SetString(L"headingNoPlugs",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_HEADING_NOPLUGS));
- localized_strings.SetString(L"filename",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_FILENAME_LABEL));
- localized_strings.SetString(L"mimetype",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_MIMETYPE_LABEL));
- localized_strings.SetString(L"description",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_DESCRIPTION_LABEL));
- localized_strings.SetString(L"suffixes",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_SUFFIX_LABEL));
- localized_strings.SetString(L"enabled",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_ENABLED_LABEL));
- localized_strings.SetString(L"enabled_yes",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_ENABLED_YES));
- localized_strings.SetString(L"enabled_no",
- l10n_util::GetString(IDS_ABOUT_PLUGINS_ENABLED_NO));
-
- ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
-
- static const base::StringPiece plugins_html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_ABOUT_PLUGINS_HTML));
-
- return jstemplate_builder::GetTemplatesHtml(
- plugins_html, &localized_strings, "t" /* template root node id */);
-}
-
std::string AboutStats() {
// We keep the DictionaryValue tree live so that we can do delta
// stats computations across runs.
@@ -694,8 +659,6 @@ void AboutSource::StartDataRequest(const std::string& path_raw,
} else if (path == kTasksPath) {
response = AboutObjects(info);
#endif
- } else if (path == kPluginsPath) {
- response = AboutPlugins();
} else if (path == kStatsPath) {
response = AboutStats();
#if defined(USE_TCMALLOC)
@@ -932,6 +895,12 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) {
return true;
}
+ // Rewrite about:plugins to chrome://plugins/.
+ if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutPluginsURL)) {
+ *url = GURL(chrome::kChromeUIPluginsURL);
+ return true;
+ }
+
// Handle URL to crash the browser process.
if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBrowserCrash)) {
// Induce an intentional crash in the browser process.
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index 64127cb..5e74cfa 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -11,7 +11,6 @@ without changes to the corresponding grd file. fbt1 -->
</outputs>
<release seq="1">
<includes>
- <include name="IDR_ABOUT_PLUGINS_HTML" file="resources\about_plugins.html" type="BINDATA" />
<include name="IDR_ABOUT_VERSION_HTML" file="resources\about_version.html" flattenhtml="true" type="BINDATA" />
<if expr="os == 'linux2' or os == 'freebsd7' or os == 'openbsd4'">
diff --git a/chrome/browser/resources/about_plugins.html b/chrome/browser/resources/about_plugins.html
deleted file mode 100644
index 72eb347..0000000
--- a/chrome/browser/resources/about_plugins.html
+++ /dev/null
@@ -1,205 +0,0 @@
-<!DOCTYPE HTML>
-<html id="t" i18n-values="dir:textdirection;">
-<head>
-<meta charset="utf-8">
-
-<!--
-A modified version of the about:plugins page found in Mozilla. The license of
-the original file is below.
--->
-
-<!-- ***** BEGIN LICENSE BLOCK *****
- - Version: MPL 1.1/GPL 2.0/LGPL 2.1
- -
- - The contents of this file are subject to the Mozilla Public License Version
- - 1.1 (the "License"); you may not use this file except in compliance with
- - the License. You may obtain a copy of the License at
- - http://www.mozilla.org/MPL/
- -
- - Software distributed under the License is distributed on an "AS IS" basis,
- - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- - for the specific language governing rights and limitations under the
- - License.
- -
- - The Original Code is mozilla.org Code.
- -
- - The Initial Developer of the Original Code is
- - Netscape Communications Corporation.
- - Portions created by the Initial Developer are Copyright (C) 1998
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Mark Olson <maolson@earthlink.net>
- - Alexey Chernyak <alexeyc@bigfoot.com>
- - Frank Tang <ftang@netscape.com>
- - Mike Connelly <mozilla@shepherdstown.com>
- - Robert Kaiser <kairo@kairo.at>
- -
- - Alternatively, the contents of this file may be used under the terms of
- - either the GNU General Public License Version 2 or later (the "GPL"), or
- - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- - in which case the provisions of the GPL or the LGPL are applicable instead
- - of those above. If you wish to allow use of your version of this file only
- - under the terms of either the GPL or the LGPL, and not to allow others to
- - use your version of this file under the terms of the MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. If you do not delete
- - the provisions above, a recipient may use your version of this file under
- - the terms of any one of the MPL, the GPL or the LGPL.
- -
- - ***** END LICENSE BLOCK ***** -->
-
-<title jscontent="title"></title>
-<style>
-
-div#outside {
- text-align: justify;
- width: 90%;
- margin-left: 5%;
- margin-right: 5%;
-}
-
-h1 {
- text-align: center;
-}
-
-h2.plugname {
- margin-top: 2em;
- margin-bottom: 1em;
-}
-
-dl {
- margin: 0px 0px 3px 0px;
-}
-
-table {
- text-align: left;
- width: 100%;
- border: 1px solid ThreeDShadow;
- border-spacing: 0px;
-}
-
-html[dir='rtl'] table {
- text-align: right;
-}
-
-th {
- text-align: center;
- background-color: Highlight;
- color: HighlightText;
-}
-
-html[dir='ltr'] th + th,
-html[dir='ltr'] td + td {
- border-left: 1px dotted ThreeDShadow;
-}
-
-html[dir='rtl'] th + th,
-html[dir='rtl'] td + td {
- border-right: 1px dotted ThreeDShadow;
-}
-
-td {
- text-align: left;
- border-top: 1px dotted ThreeDShadow;
-}
-
-html[dir='rtl'] td {
- text-align: right;
-}
-
-th, td {
- padding: 3px;
-}
-
-th.type, th.suff {
- width: 20%;
-}
-
-th.desc {
- width: 50%;
-}
-
-th.enabled {
- width: 10%;
-}
-</style>
-</head>
-<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
-<div id="outside">
-<script type="application/x-javascript">
-
- /* JavaScript to enumerate and display all installed plug-ins
-
- * First, refresh plugins in case anything has been changed recently in
- * prefs: (The "false" argument tells refresh not to reload or activate
- * any plug-ins that would be active otherwise. In contrast, one would
- * use "true" in the case of ASD instead of restarting)
- */
-
- navigator.plugins.refresh(false);
-
- var numPlugins = navigator.plugins.length;
-
- if (numPlugins > 0)
- document.writeln('<h1 id="plugs" jscontent="headingPlugs"><\/h1>');
- else
- document.writeln('<h1 id="noplugs" jscontent="headingNoPlugs"><\/h1>');
-
- for (var i = 0; i < numPlugins; i++)
- {
- var plugin = navigator.plugins[i];
-
- if (plugin)
- {
- document.write("<h2 class=\"plugname\">");
- document.write(plugin.name);
- document.writeln("<\/h2>");
-
- document.writeln('<dl><dd><span jscontent="filename"><\/span> ');
- document.write(plugin.filename);
- document.writeln("<\/dd><dd>");
- document.write(plugin.description);
- document.writeln("<\/dd><\/dl>");
-
- document.writeln('<table class="contenttable">');
- document.writeln("<thead>");
- document.writeln('<tr><th class="type" jscontent="mimetype"><\/th>');
- document.writeln('<th class="desc" jscontent="description"><\/th>');
- document.writeln('<th class="suff" jscontent="suffixes"><\/th>');
- document.writeln('<th class="enabled" jscontent="enabled"><\/th><\/tr>');
- document.writeln("<\/thead>");
- document.writeln("<tbody>");
-
- var numTypes = plugin.length;
- var mimetype;
- var enabled;
- var enabledPlugin;
- for (var j = 0; j < numTypes; j++)
- {
- mimetype = plugin[j];
-
- if (mimetype)
- {
- enabled = "enabled_no";
- enabledPlugin = mimetype.enabledPlugin;
- if (enabledPlugin && (enabledPlugin.filename == plugin.filename))
- enabled = "enabled_yes";
-
- document.writeln("<tr>");
- document.writeln("<td>" + mimetype.type + "<\/td>");
- document.writeln("<td>" + mimetype.description + "<\/td>");
- document.writeln("<td>" + mimetype.suffixes + "<\/td>");
- document.writeln('<td jscontent="' + enabled + '"><\/td>');
- document.writeln("<\/tr>");
- }
- }
-
- document.write("<\/tbody>");
- document.write("<\/table>");
- }
- }
-</script>
-</div>
-</body>
-</html>
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index d770685..eb6fc0d 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -43,6 +43,7 @@ const char kAboutCreditsURL[] = "about:credits";
const char kAboutHangURL[] = "about:hang";
const char kAboutMemoryURL[] = "about:memory";
const char kAboutNetInternalsURL[] = "about:net-internals";
+const char kAboutPluginsURL[] = "about:plugins";
const char kAboutShorthangURL[] = "about:shorthang";
const char kAboutTermsURL[] = "about:terms";
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index d4f2ee5..55c49a4 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -41,6 +41,7 @@ extern const char kAboutCrashURL[];
extern const char kAboutCreditsURL[];
extern const char kAboutHangURL[];
extern const char kAboutMemoryURL[];
+extern const char kAboutPluginsURL[];
extern const char kAboutShorthangURL[];
extern const char kAboutTermsURL[];