| 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
| 6 <include src="history_focus_manager.js"> | 6 <include src="history_focus_manager.js"> |
| 7 | 7 |
| 8 /////////////////////////////////////////////////////////////////////////////// | 8 /////////////////////////////////////////////////////////////////////////////// |
| 9 // Globals: | 9 // Globals: |
| 10 /** @const */ var RESULTS_PER_PAGE = 150; | 10 /** @const */ var RESULTS_PER_PAGE = 150; |
| (...skipping 1918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 HistoryFocusManager.getInstance().initialize(); | 1929 HistoryFocusManager.getInstance().initialize(); |
| 1930 | 1930 |
| 1931 var doSearch = function(e) { | 1931 var doSearch = function(e) { |
| 1932 recordUmaAction('HistoryPage_Search'); | 1932 recordUmaAction('HistoryPage_Search'); |
| 1933 historyView.setSearch(searchField.value); | 1933 historyView.setSearch(searchField.value); |
| 1934 | 1934 |
| 1935 if (isMobileVersion()) | 1935 if (isMobileVersion()) |
| 1936 searchField.blur(); // Dismiss the keyboard. | 1936 searchField.blur(); // Dismiss the keyboard. |
| 1937 }; | 1937 }; |
| 1938 | 1938 |
| 1939 var removeMenu = $('remove-visit'); | 1939 var removeMenu = getRequiredElement('remove-visit'); |
| 1940 // Decorate remove-visit before disabling/hiding because the values are | 1940 // Decorate remove-visit before disabling/hiding because the values are |
| 1941 // overwritten when decorating a MenuItem that has a Command. | 1941 // overwritten when decorating a MenuItem that has a Command. |
| 1942 cr.ui.decorate(removeMenu, MenuItem); | 1942 cr.ui.decorate(removeMenu, MenuItem); |
| 1943 removeMenu.disabled = !loadTimeData.getBoolean('allowDeletingHistory'); | 1943 removeMenu.disabled = !loadTimeData.getBoolean('allowDeletingHistory'); |
| 1944 removeMenu.hidden = loadTimeData.getBoolean('hideDeleteVisitUI'); | 1944 removeMenu.hidden = loadTimeData.getBoolean('hideDeleteVisitUI'); |
| 1945 | 1945 |
| 1946 document.addEventListener('command', handleCommand); | 1946 document.addEventListener('command', handleCommand); |
| 1947 | 1947 |
| 1948 searchField.addEventListener('search', doSearch); | 1948 searchField.addEventListener('search', doSearch); |
| 1949 $('search-button').addEventListener('click', doSearch); | 1949 $('search-button').addEventListener('click', doSearch); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2381 historyView.reload(); | 2381 historyView.reload(); |
| 2382 } | 2382 } |
| 2383 | 2383 |
| 2384 // Add handlers to HTML elements. | 2384 // Add handlers to HTML elements. |
| 2385 document.addEventListener('DOMContentLoaded', load); | 2385 document.addEventListener('DOMContentLoaded', load); |
| 2386 | 2386 |
| 2387 // This event lets us enable and disable menu items before the menu is shown. | 2387 // This event lets us enable and disable menu items before the menu is shown. |
| 2388 document.addEventListener('canExecute', function(e) { | 2388 document.addEventListener('canExecute', function(e) { |
| 2389 e.canExecute = true; | 2389 e.canExecute = true; |
| 2390 }); | 2390 }); |
| OLD | NEW |