Index: chrome/browser/resources/history/history.js |
diff --git a/chrome/browser/resources/history/history.js b/chrome/browser/resources/history/history.js |
index 1227c99fe478fdc36b50399cc090c380ed4d447a..4ef1b84955ee177c8c873abfa10142e76ef3d81a 100644 |
--- a/chrome/browser/resources/history/history.js |
+++ b/chrome/browser/resources/history/history.js |
@@ -938,6 +938,13 @@ HistoryView.prototype.onModelReady = function(doneLoading) { |
document.body.classList.remove('has-results'); |
this.updateNavBar_(); |
+ |
+ if (isMobileVersion()) { |
+ // Hide the search field if it is empty and there are no results. |
+ var hasResults = this.model_.visits_.length > 0; |
+ var isSearch = this.model_.getSearchText().length > 0; |
+ $('search-field').hidden = !(hasResults || isSearch); |
+ } |
}; |
/** |
@@ -1298,7 +1305,6 @@ HistoryView.prototype.displayResults_ = function(doneLoading) { |
createElementWithClassName('div', 'no-results-message')); |
noResults.textContent = loadTimeData.getString('noResults'); |
this.resultDiv_.appendChild(resultsFragment); |
- this.updateNavBar_(); |
return; |
} |
@@ -1326,7 +1332,6 @@ HistoryView.prototype.displayResults_ = function(doneLoading) { |
// Add all the days and their visits to the page. |
this.resultDiv_.appendChild(resultsFragment); |
} |
- this.updateNavBar_(); |
}; |
/** |
@@ -1335,9 +1340,10 @@ HistoryView.prototype.displayResults_ = function(doneLoading) { |
*/ |
HistoryView.prototype.updateNavBar_ = function() { |
this.updateRangeButtons_(); |
+ |
+ // Managed users have the control bar on top, don't show it on the bottom |
+ // as well. |
if (!loadTimeData.getBoolean('isManagedProfile')) { |
- // Managed users have the control bar on top, don't show it on the bottom |
- // as well. |
$('newest-button').hidden = this.pageIndex_ == 0; |
$('newer-button').hidden = this.pageIndex_ == 0; |
$('older-button').hidden = |