summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 17:56:55 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 17:56:55 +0000
commit1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9 (patch)
treeac4c18a2820dc064739fceb824a9994795b783d3 /chrome/browser/resources
parent90caf65af4eaa06b4c72bc22ba46363633b94029 (diff)
downloadchromium_src-1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9.zip
chromium_src-1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9.tar.gz
chromium_src-1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9.tar.bz2
Updates to NTP per UI review:
1) Turn off logo/attribution completely when it overlaps with the content. 2) Replace the single-item dropdown menu in the most visited section with a text link to restore blacklisted URLs. The link should only be visible if there are any blacklisted URLs. BUG=55196,55208 TEST=unit_tests --gtest-filter=TopSitesTest.* Review URL: http://codereview.chromium.org/3361015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/new_new_tab.css35
-rw-r--r--chrome/browser/resources/new_new_tab.html9
-rw-r--r--chrome/browser/resources/new_new_tab.js7
-rw-r--r--chrome/browser/resources/new_tab_theme.css8
-rw-r--r--chrome/browser/resources/ntp/most_visited.css24
-rw-r--r--chrome/browser/resources/ntp/most_visited.js13
6 files changed, 49 insertions, 47 deletions
diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css
index 62232ce..1e4c921 100644
--- a/chrome/browser/resources/new_new_tab.css
+++ b/chrome/browser/resources/new_new_tab.css
@@ -232,7 +232,7 @@ html[dir=rtl] #attribution {
}
#attribution.obscured {
- opacity: 0.3;
+ visibility: hidden;
}
html[hasattribution=false] #attribution > div {
@@ -311,39 +311,6 @@ html[anim=true] .section > h2 > .disclosure {
z-index: 2;
}
-.section > h2 .settings-wrapper {
- position: absolute;
- top: -1px;
- right: 0;
- width: 21px;
- height: 21px;
- z-index: 3;
-}
-
-html[dir=rtl] .section > h2 .settings-wrapper {
- left: 0;
- right: auto;
-}
-
-.section > h2 .settings {
- /* TODO(aa): Need a better image. This one is semi-transparent. Also, I think
- a gear would be better. */
- background-color: transparent;
- background-image: url(chrome://theme/IDR_BALLOON_WRENCH);
- background-position: center center;
- background-repeat: no-repeat;
- border: 0;
- height: 13px;
- left: 5px;
- position: absolute;
- top: 5px;
- width: 13px;
-}
-
-.section.hidden > h2 .settings-wrapper {
- display: none;
-}
-
.maxiview {
padding: 5px 0 30px;
position: absolute;
diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html
index 1a88c6d..1443c7c 100644
--- a/chrome/browser/resources/new_new_tab.html
+++ b/chrome/browser/resources/new_new_tab.html
@@ -147,9 +147,8 @@ if ('mode' in hashParams) {
<img class="disclosure" src="ntp/ntp_disclosure_triangle.png">
<div class="back"></div>
<span i18n-content="mostvisited"></span>
- <div class="settings-wrapper">
- <button class="settings" menu="#option-menu"></button>
- </div>
+ <button id="most-visited-settings" i18n-content="restorethumbnails">
+ </button>
</h2>
<div class="miniview"></div>
</div>
@@ -181,10 +180,6 @@ if ('mode' in hashParams) {
<command id="apps-options-command" i18n-values=".label:appoptions">
<command id="apps-uninstall-command" i18n-values=".label:appuninstall">
-<menu id="option-menu">
- <button command="#clear-all-blacklisted"></button>
-</menu>
-
<menu id="app-context-menu">
<button class="default" command="#apps-launch-command"></button>
<hr>
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 7ba47c1..1781c9a 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -669,6 +669,10 @@ $('main').addEventListener('click', function(e) {
toggleSectionVisibilityAndAnimate(p.getAttribute('section'));
});
+$('most-visited-settings').addEventListener('click', function() {
+ $('clear-all-blacklisted').execute();
+});
+
function toggleSectionVisibilityAndAnimate(section) {
if (!section)
return;
@@ -924,9 +928,10 @@ var mostVisited = new MostVisited(
useSmallGrid(),
shownSections & Section.THUMB);
-function mostVisitedPages(data, firstRun) {
+function mostVisitedPages(data, firstRun, hasBlacklistedUrls) {
logEvent('received most visited pages');
+ mostVisited.updateSettingsLink(hasBlacklistedUrls);
mostVisited.data = data;
mostVisited.layout();
layoutSections();
diff --git a/chrome/browser/resources/new_tab_theme.css b/chrome/browser/resources/new_tab_theme.css
index e21eaef..440347e 100644
--- a/chrome/browser/resources/new_tab_theme.css
+++ b/chrome/browser/resources/new_tab_theme.css
@@ -1,6 +1,6 @@
html,
-.section > h2 .settings-wrapper,
-.section > h2 span {
+.section > h2 span,
+#most-visited-settings {
background-attachment: fixed;
background-color: $2; /* COLOR_NTP_BACKGROUND */
background-image: url(chrome://theme/IDR_THEME_NTP_BACKGROUND?$1);
@@ -9,8 +9,8 @@ html,
}
html[bookmarkbarattached='true'],
-html[bookmarkbarattached='true'] .section > h2 .settings-wrapper,
-html[bookmarkbarattached='true'] .section > h2 span {
+html[bookmarkbarattached='true'] .section > h2 span,
+html[bookmarkbarattached='true'] #most-visited-settings {
background-position: $4;
}
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++) {