summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorcsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 21:58:31 +0000
committercsilv@chromium.org <csilv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 21:58:31 +0000
commitc2f578b5b28ac26d039ba0b1bb57f76f94a2168a (patch)
tree8d0a503859fd398dbbb9a53ce39389451f0dc582 /chrome
parent1c5ba1401e2c40a9d1a5b58751230d66c3c747bd (diff)
downloadchromium_src-c2f578b5b28ac26d039ba0b1bb57f76f94a2168a.zip
chromium_src-c2f578b5b28ac26d039ba0b1bb57f76f94a2168a.tar.gz
chromium_src-c2f578b5b28ac26d039ba0b1bb57f76f94a2168a.tar.bz2
web-ui: add support for target="_blank" for about: & file: links.
BUG=76263 TEST=Click on 'disable individual plugins' link in settings, link should open in new tab. Review URL: http://codereview.chromium.org/6738001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/options/content_settings.html4
-rw-r--r--chrome/browser/resources/shared/js/util.js11
-rw-r--r--chrome/browser/ui/webui/generic_handler.cc14
3 files changed, 20 insertions, 9 deletions
diff --git a/chrome/browser/resources/options/content_settings.html b/chrome/browser/resources/options/content_settings.html
index c9805c7..3b66704 100644
--- a/chrome/browser/resources/options/content_settings.html
+++ b/chrome/browser/resources/options/content_settings.html
@@ -108,8 +108,8 @@
<button class="exceptions-list-button" contentType="plugins"
i18n-content="manage_exceptions"></button>
- <a i18n-content="disable_individual_plugins" id="plugins-tab"
- href="about:plugins">
+ <a id="plugins-tab" href="about:plugins"
+ i18n-content="disable_individual_plugins" target="_blank">
</a>
</div>
</section>
diff --git a/chrome/browser/resources/shared/js/util.js b/chrome/browser/resources/shared/js/util.js
index ff75b0c..8956f7b 100644
--- a/chrome/browser/resources/shared/js/util.js
+++ b/chrome/browser/resources/shared/js/util.js
@@ -124,8 +124,15 @@ document.addEventListener('click', function(e) {
if ((el.protocol == 'file:' || el.protocol == 'about:') &&
(e.button == 0 || e.button == 1)) {
- chrome.send('navigateToUrl',
- [el.href, e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
+ chrome.send('navigateToUrl', [
+ el.href,
+ el.target,
+ e.button,
+ e.altKey,
+ e.ctrlKey,
+ e.metaKey,
+ e.shiftKey
+ ]);
e.preventDefault();
}
}
diff --git a/chrome/browser/ui/webui/generic_handler.cc b/chrome/browser/ui/webui/generic_handler.cc
index 7bfe8f5..1544821 100644
--- a/chrome/browser/ui/webui/generic_handler.cc
+++ b/chrome/browser/ui/webui/generic_handler.cc
@@ -23,6 +23,7 @@ void GenericHandler::RegisterMessages() {
void GenericHandler::HandleNavigateToUrl(const ListValue* args) {
std::string url_string;
+ std::string target_string;
double button;
bool alt_key;
bool ctrl_key;
@@ -30,11 +31,12 @@ void GenericHandler::HandleNavigateToUrl(const ListValue* args) {
bool shift_key;
CHECK(args->GetString(0, &url_string));
- CHECK(args->GetDouble(1, &button));
- CHECK(args->GetBoolean(2, &alt_key));
- CHECK(args->GetBoolean(3, &ctrl_key));
- CHECK(args->GetBoolean(4, &meta_key));
- CHECK(args->GetBoolean(5, &shift_key));
+ CHECK(args->GetString(1, &target_string));
+ CHECK(args->GetDouble(2, &button));
+ CHECK(args->GetBoolean(3, &alt_key));
+ CHECK(args->GetBoolean(4, &ctrl_key));
+ CHECK(args->GetBoolean(5, &meta_key));
+ CHECK(args->GetBoolean(6, &shift_key));
CHECK(button == 0.0 || button == 1.0);
bool middle_button = (button == 1.0);
@@ -42,6 +44,8 @@ void GenericHandler::HandleNavigateToUrl(const ListValue* args) {
WindowOpenDisposition disposition =
disposition_utils::DispositionFromClick(middle_button, alt_key, ctrl_key,
meta_key, shift_key);
+ if (disposition == CURRENT_TAB && target_string == "_blank")
+ disposition = NEW_FOREGROUND_TAB;
web_ui_->tab_contents()->OpenURL(
GURL(url_string), GURL(), disposition, PageTransition::LINK);