OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * Called from the main frame when unloading. | 8 * Called from the main frame when unloading. |
9 * @param {boolean=} opt_exiting True if the app is exiting. | 9 * @param {boolean=} opt_exiting True if the app is exiting. |
10 */ | 10 */ |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 var createShareMenu = function(tasks) { | 813 var createShareMenu = function(tasks) { |
814 var wasHidden = this.shareMenu_.hidden; | 814 var wasHidden = this.shareMenu_.hidden; |
815 this.shareMenu_.hidden = true; | 815 this.shareMenu_.hidden = true; |
816 var items = this.shareMenu_.querySelectorAll('.item'); | 816 var items = this.shareMenu_.querySelectorAll('.item'); |
817 for (var i = 0; i !== items.length; i++) { | 817 for (var i = 0; i !== items.length; i++) { |
818 items[i].parentNode.removeChild(items[i]); | 818 items[i].parentNode.removeChild(items[i]); |
819 } | 819 } |
820 | 820 |
821 for (var t = 0; t !== tasks.length; t++) { | 821 for (var t = 0; t !== tasks.length; t++) { |
822 var task = tasks[t]; | 822 var task = tasks[t]; |
823 if (!isShareAction(task)) continue; | 823 if (!isShareAction(task)) |
| 824 continue; |
| 825 // Filter out Files.app tasks. |
| 826 // TODO(hirono): Remove the hack after the files.app's handlers are |
| 827 // removed. |
| 828 if (task.taskId.indexOf('hhaomjibdihmijegdhdafkllkbggdgoj|') === 0) |
| 829 continue; |
824 | 830 |
825 var item = util.createChild(this.shareMenu_, 'item'); | 831 var item = util.createChild(this.shareMenu_, 'item'); |
826 item.textContent = task.title; | 832 item.textContent = task.title; |
827 item.style.backgroundImage = 'url(' + task.iconUrl + ')'; | 833 item.style.backgroundImage = 'url(' + task.iconUrl + ')'; |
828 item.addEventListener('click', function(taskId) { | 834 item.addEventListener('click', function(taskId) { |
829 this.toggleShare_(); // Hide the menu. | 835 this.toggleShare_(); // Hide the menu. |
830 // TODO(hirono): Use entries instead of URLs. | 836 // TODO(hirono): Use entries instead of URLs. |
831 this.executeWhenReady( | 837 this.executeWhenReady( |
832 api.executeTask.bind( | 838 api.executeTask.bind( |
833 api, | 839 api, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 ]).then(function(args) { | 899 ]).then(function(args) { |
894 var backgroundComponents = args[0]; | 900 var backgroundComponents = args[0]; |
895 var entries = args[1]; | 901 var entries = args[1]; |
896 window.loadTimeData.data = backgroundComponents.stringData; | 902 window.loadTimeData.data = backgroundComponents.stringData; |
897 var gallery = new Gallery(backgroundComponents.volumeManager); | 903 var gallery = new Gallery(backgroundComponents.volumeManager); |
898 gallery.load(entries.allEntries, entries.selectedEntries); | 904 gallery.load(entries.allEntries, entries.selectedEntries); |
899 }).catch(function(error) { | 905 }).catch(function(error) { |
900 console.error(error.stack || error); | 906 console.error(error.stack || error); |
901 }); | 907 }); |
902 }); | 908 }); |
OLD | NEW |