Index: chrome/browser/resources/apps_debugger/js/items_list.js |
diff --git a/chrome/browser/resources/apps_debugger/js/items_list.js b/chrome/browser/resources/apps_debugger/js/items_list.js |
index 4baefa1e043e2db69a6f61e202eea1f9868b4532..0dcc613367d0f40c54347ec2570962ba38c6a001 100644 |
--- a/chrome/browser/resources/apps_debugger/js/items_list.js |
+++ b/chrome/browser/resources/apps_debugger/js/items_list.js |
@@ -146,6 +146,9 @@ cr.define('apps_dev_tool', function() { |
var description = node.querySelector('.extension-description span'); |
description.textContent = item.description; |
+ // The 'allow in incognito' checkbox. |
+ this.setAllowIncognitoCheckbox_(item, node); |
+ |
// The 'allow file:// access' checkbox. |
if (item.wants_file_access) |
this.setAllowFileAccessCheckbox_(item, node); |
@@ -315,6 +318,26 @@ cr.define('apps_dev_tool', function() { |
}, |
/** |
+ * Sets the handler for the allow_incognito checkbox. |
+ * @param {!Object} item A dictionary of item metadata. |
+ * @param {HTMLElement} el HTML element containing all items. |
+ * @private |
+ */ |
+ setAllowIncognitoCheckbox_: function(item, el) { |
+ if (item.allow_incognito) { |
+ var incognito = el.querySelector('.incognito-control'); |
+ incognito.addEventListener('change', function(e) { |
+ chrome.developerPrivate.allowIncognito( |
+ item.id, !!e.target.checked, function() { |
+ ItemsList.loadItemsInfo(); |
+ }); |
+ }); |
+ incognito.querySelector('input').checked = item.incognito_enabled; |
+ incognito.hidden = false; |
+ } |
+ }, |
+ |
+ /** |
* Sets the active views link of an item. Clicking on the link |
* opens devtools window to inspect. |
* @param {!Object} item A dictionary of item metadata. |