summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaznacheev@chromium.org <kaznacheev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 08:30:06 +0000
committerkaznacheev@chromium.org <kaznacheev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 08:30:06 +0000
commit06c4816480750a218e5361e96ffe673f00a9b552 (patch)
tree4518244c720a2f612d7d771e2bd602d861aac647
parent3cfd5469afe7a919321695c274168ade13a9ddf2 (diff)
downloadchromium_src-06c4816480750a218e5361e96ffe673f00a9b552.zip
chromium_src-06c4816480750a218e5361e96ffe673f00a9b552.tar.gz
chromium_src-06c4816480750a218e5361e96ffe673f00a9b552.tar.bz2
Avoid using chrome.tabs API in a packaged Files app
BUG=160005 Review URL: https://codereview.chromium.org/11275260 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167331 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/file_manager/js/drive_banners.js5
-rw-r--r--chrome/browser/resources/file_manager/js/file_manager.js10
2 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/resources/file_manager/js/drive_banners.js b/chrome/browser/resources/file_manager/js/drive_banners.js
index fa20566..84d36da 100644
--- a/chrome/browser/resources/file_manager/js/drive_banners.js
+++ b/chrome/browser/resources/file_manager/js/drive_banners.js
@@ -131,10 +131,11 @@ FileListBannerController.prototype.showBanner_ = function(type, messageId) {
more.textContent = str('GDATA_LEARN_MORE');
more.href = GOOGLE_DRIVE_FAQ_URL;
}
+ more.target = '_blank';
var dismiss;
if (this.newWelcome_)
- dismiss = util.createChild(links, 'gdata-welcome-button', 'a');
+ dismiss = util.createChild(links, 'gdata-welcome-button');
else
dismiss = util.createChild(links, 'plain-link');
@@ -430,6 +431,7 @@ FileListBannerController.prototype.showLowDownloadsSpaceWarning_ =
box.innerHTML = html;
var link = box.querySelector('a');
link.href = DOWNLOADS_FAQ_URL;
+ link.target = '_blank';
} else {
box.innerHTML = '';
}
@@ -477,6 +479,7 @@ FileListBannerController.prototype.ensureGDataUnmountedPanelInitialized_ =
var learnMore = create(panel, 'a', 'learn-more plain-link',
str('GDATA_LEARN_MORE'));
learnMore.href = GOOGLE_DRIVE_ERROR_HELP_URL;
+ learnMore.target = '_blank';
};
/**
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index 27fabf2..1828191 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -2034,11 +2034,17 @@ DialogType.isModal = function(type) {
FileManager.prototype.onExternalLinkClick_ = function(event) {
if (event.target.tagName != 'A' || !event.target.href)
return;
- chrome.tabs.create({url: event.target.href});
+
+ // In a packaged apps links with targer='_blank' open in a new tab by
+ // default, other links do not open at all.
+ if (!util.platform.v2()) {
+ chrome.tabs.create({url: event.target.href});
+ event.preventDefault();
+ }
+
if (this.dialogType != DialogType.FULL_PAGE) {
this.onCancel_();
}
- event.preventDefault();
};
/**