diff options
Diffstat (limited to 'chrome/browser/resources/ntp')
-rw-r--r-- | chrome/browser/resources/ntp/most_visited.css | 24 | ||||
-rw-r--r-- | chrome/browser/resources/ntp/most_visited.js | 13 |
2 files changed, 36 insertions, 1 deletions
diff --git a/chrome/browser/resources/ntp/most_visited.css b/chrome/browser/resources/ntp/most_visited.css index 3512d59..27f2958 100644 --- a/chrome/browser/resources/ntp/most_visited.css +++ b/chrome/browser/resources/ntp/most_visited.css @@ -256,3 +256,27 @@ html[dir=rtl] .thumbnail-container > .title > div { background-size: 150px 93px; } } + +#most-visited-settings { + position: absolute; + top: 1px; + right: 0; + border: 0; + cursor: pointer; + font-size: 70%; + margin: 0; + padding: 0; + text-decoration: underline; + visibility: hidden; + -webkit-padding-start: 3px; + z-index: 3; +} + +html[dir=rtl] #most-visited-settings { + left: 0; + right: auto; +} + +#most-visited:not(.hidden) #most-visited-settings.has-blacklist { + visibility: visible; +} diff --git a/chrome/browser/resources/ntp/most_visited.js b/chrome/browser/resources/ntp/most_visited.js index 5b024b2..c5f1967 100644 --- a/chrome/browser/resources/ntp/most_visited.js +++ b/chrome/browser/resources/ntp/most_visited.js @@ -104,6 +104,13 @@ var MostVisited = (function() { this.data[sourceIndex] = destinationData; }, + updateSettingsLink: function(hasBlacklistedUrls) { + if (hasBlacklistedUrls) + $('most-visited-settings').classList.add('has-blacklist'); + else + $('most-visited-settings').classList.remove('has-blacklist'); + }, + blacklist: function(el) { var self = this; var url = el.href; @@ -126,7 +133,11 @@ var MostVisited = (function() { // Send 'getMostVisitedPages' with a callback since we want to find the // new page and add that in the place of the removed page. - chromeSend('getMostVisited', [], 'mostVisitedPages', function(data) { + chromeSend('getMostVisited', [], 'mostVisitedPages', + function(data, firstRun, hasBlacklistedUrls) { + // Update settings link. + self.updateSettingsLink(hasBlacklistedUrls); + // Find new item. var newItem; for (var i = 0; i < data.length; i++) { |