Index: chrome/browser/resources/aura/app_list/app_list.js |
diff --git a/chrome/browser/resources/aura/app_list/app_list.js b/chrome/browser/resources/aura/app_list/app_list.js |
index 5d20e9c5913e441c484ab6d8d71cb5ec23a63095..dc128054cb6a27ae57caa4820ff11c3d08a057d6 100644 |
--- a/chrome/browser/resources/aura/app_list/app_list.js |
+++ b/chrome/browser/resources/aura/app_list/app_list.js |
@@ -23,6 +23,21 @@ cr.define('appList', function() { |
*/ |
function load() { |
appsView = new appList.AppsView(); |
+ |
+ document.addEventListener('click', onDocClick); |
+ } |
+ |
+ /** |
+ * Document click event handler. |
+ */ |
+ function onDocClick(e) { |
+ // Close if click is on body, or not on app, paging dot or its children. |
+ if (e.target == document.body || |
+ (!e.target.classList.contains('app') && |
+ !e.target.classList.contains('dot') && |
+ !findAncestorByClass(e.target, 'dot'))) { |
+ chrome.send('close'); |
+ } |
} |
/** |
@@ -46,6 +61,7 @@ cr.define('appList', function() { |
function getAppsCallback(data) { |
appsView.getAppsCallback(data); |
+ chrome.send('onAppsLoaded'); |
} |
function getAppsPageIndex(page) { |