| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more | 5 // To avoid creating tons of unnecessary nodes. We assume we cannot fit more |
| 6 // than this many items in the miniview. | 6 // than this many items in the miniview. |
| 7 var MAX_MINIVIEW_ITEMS = 15; | 7 var MAX_MINIVIEW_ITEMS = 15; |
| 8 | 8 |
| 9 // Extra spacing at the top of the layout. | 9 // Extra spacing at the top of the layout. |
| 10 var LAYOUT_SPACING_TOP = 5; | 10 var LAYOUT_SPACING_TOP = 5; |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 var command = item.getAttribute('command'); | 713 var command = item.getAttribute('command'); |
| 714 if (command in this.commands) { | 714 if (command in this.commands) { |
| 715 this.commands[command].call(this, item); | 715 this.commands[command].call(this, item); |
| 716 } | 716 } |
| 717 | 717 |
| 718 this.hide(); | 718 this.hide(); |
| 719 } | 719 } |
| 720 }; | 720 }; |
| 721 | 721 |
| 722 var optionMenu = new OptionMenu( | 722 var optionMenu = new OptionMenu( |
| 723 document.querySelector('#most-visited-section h2 .settings'), | 723 document.querySelector('#most-visited-section h2 .settings-wrapper'), |
| 724 $('option-menu')); | 724 $('option-menu')); |
| 725 optionMenu.commands = { | 725 optionMenu.commands = { |
| 726 'clear-all-blacklisted' : function() { | 726 'clear-all-blacklisted' : function() { |
| 727 mostVisited.clearAllBlacklisted(); | 727 mostVisited.clearAllBlacklisted(); |
| 728 chrome.send('getMostVisited'); | 728 chrome.send('getMostVisited'); |
| 729 } | 729 } |
| 730 }; | 730 }; |
| 731 | 731 |
| 732 $('main').addEventListener('click', function(e) { | 732 $('main').addEventListener('click', function(e) { |
| 733 var p = e.target; | 733 var p = e.target; |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 window.setTimeout(function() { | 1022 window.setTimeout(function() { |
| 1023 mostVisited.ensureSmallGridCorrect(); | 1023 mostVisited.ensureSmallGridCorrect(); |
| 1024 document.body.classList.remove('loading'); | 1024 document.body.classList.remove('loading'); |
| 1025 }, 1); | 1025 }, 1); |
| 1026 | 1026 |
| 1027 // Only show the first run notification if first run. | 1027 // Only show the first run notification if first run. |
| 1028 if (firstRun) { | 1028 if (firstRun) { |
| 1029 showFirstRunNotification(); | 1029 showFirstRunNotification(); |
| 1030 } | 1030 } |
| 1031 } | 1031 } |
| OLD | NEW |