| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
| 6 * @fileoverview The recently closed menu: button, model data, and menu. | 6 * @fileoverview The recently closed menu: button, model data, and menu. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('ntp', function() { | 9 cr.define('ntp', function() { |
| 10 'use strict'; | 10 'use strict'; |
| 11 | 11 |
| 12 var localStrings = new LocalStrings(); | |
| 13 | |
| 14 /** | 12 /** |
| 15 * Returns the text used for a recently closed window. | 13 * Returns the text used for a recently closed window. |
| 16 * @param {number} numTabs Number of tabs in the window. | 14 * @param {number} numTabs Number of tabs in the window. |
| 17 * @return {string} The text to use. | 15 * @return {string} The text to use. |
| 18 */ | 16 */ |
| 19 function formatTabsText(numTabs) { | 17 function formatTabsText(numTabs) { |
| 20 if (numTabs == 1) | 18 if (numTabs == 1) |
| 21 return localStrings.getString('closedwindowsingle'); | 19 return loadTimeData.getString('closedwindowsingle'); |
| 22 return localStrings.getStringF('closedwindowmultiple', numTabs); | 20 return loadTimeData.getStringF('closedwindowmultiple', numTabs); |
| 23 } | 21 } |
| 24 | 22 |
| 25 var Menu = cr.ui.Menu; | 23 var Menu = cr.ui.Menu; |
| 26 var MenuItem = cr.ui.MenuItem; | 24 var MenuItem = cr.ui.MenuItem; |
| 27 var MenuButton = cr.ui.MenuButton; | 25 var MenuButton = cr.ui.MenuButton; |
| 28 var RecentMenuButton = cr.ui.define('button'); | 26 var RecentMenuButton = cr.ui.define('button'); |
| 29 | 27 |
| 30 RecentMenuButton.prototype = { | 28 RecentMenuButton.prototype = { |
| 31 __proto__: MenuButton.prototype, | 29 __proto__: MenuButton.prototype, |
| 32 | 30 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 104 |
| 107 this.menu.appendChild(a); | 105 this.menu.appendChild(a); |
| 108 cr.ui.decorate(a, MenuItem); | 106 cr.ui.decorate(a, MenuItem); |
| 109 }, | 107 }, |
| 110 }; | 108 }; |
| 111 | 109 |
| 112 return { | 110 return { |
| 113 RecentMenuButton: RecentMenuButton, | 111 RecentMenuButton: RecentMenuButton, |
| 114 }; | 112 }; |
| 115 }); | 113 }); |
| OLD | NEW |