Commit 2cfaf0aa authored by David Tseng's avatar David Tseng Committed by Commit Bot

disallow links in tutorial when in incognito profile

Bug: 902432
Change-Id: Ia551251759af9c285a9d371393028ee02628718d
Reviewed-on: https://chromium-review.googlesource.com/c/1324372Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606293}
parent b43c6fca
......@@ -25,6 +25,9 @@ Tutorial = function() {
this.page = sessionStorage['tutorial_page_pos'] !== undefined ?
sessionStorage['tutorial_page_pos'] :
0;
/** @private {boolean} */
this.incognito_ = !!chrome.runtime.getManifest()['incognito'];
};
/**
......@@ -237,12 +240,18 @@ Tutorial.prototype = {
} else if (pageElement.link) {
element = document.createElement('a');
element.href = pageElement.link;
element.setAttribute('tabindex', 0);
if (!this.incognito_)
element.setAttribute('tabindex', 0);
else
element.disabled = true;
element.addEventListener('click', function(evt) {
if (this.incognito_)
return;
Panel.closeMenusAndRestoreFocus();
chrome.windows.create({url: evt.target.href});
return false;
}, false);
}.bind(this), false);
} else if (pageElement.custom) {
element = document.createElement('div');
pageElement.custom(element);
......
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