diff options
author | mirandac@google.com <mirandac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 22:37:42 +0000 |
---|---|---|
committer | mirandac@google.com <mirandac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 22:37:42 +0000 |
commit | 6677024d9674022969241eb0d8e7584871e13eae (patch) | |
tree | a53c5a907f379266c4c09bfeb617d46500cc7e94 /chrome/browser/resources | |
parent | f4ef861ba773e66d1c6e7e023a38db32afdd531d (diff) | |
download | chromium_src-6677024d9674022969241eb0d8e7584871e13eae.zip chromium_src-6677024d9674022969241eb0d8e7584871e13eae.tar.gz chromium_src-6677024d9674022969241eb0d8e7584871e13eae.tar.bz2 |
Remove tips from NTP.
BUG= 50072
TEST= no tips on NTP.
Review URL: http://codereview.chromium.org/3033032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/new_new_tab.css | 33 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 8 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 64 |
3 files changed, 5 insertions, 100 deletions
diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index a201da6..bc04233 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -245,50 +245,25 @@ html[dir=rtl] .item { margin: 0 10px; } -#set-as-home-page { - display: none; - margin: 10px 0; - text-align: center; -} - #top-bar { display: -webkit-box; -webkit-box-align: center; min-height: 56px; } -#tip-line { - -webkit-box-flex: 1; - -webkit-transition: opacity .15s; - -webkit-user-select: text; - border: 0; - cursor: text; - display: block; /* Since we are reusing the section display logic we need - to override the display for hidden tips. */ - margin: 10px; - -webkit-margin-start: 50%; - text-align: end; -} - -.notification.hidden, -#tip-line.hidden, -.notification-shown #tip-line { +.notification.hidden { opacity: 0; pointer-events: none; } -#tip-line a, -#tip-line button { - /* We do not want a trailing single word from a link on the last line */ - white-space: nowrap; -} - #option-button { -webkit-appearance: none; background-color: transparent; width: 19px; height: 17px; - margin: 0; + position: absolute; + right: 0; + top: 20px; border: 0; padding: 0; vertical-align: top; diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index c3d7ef4..3064678 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -44,14 +44,11 @@ function registerCallback(name) { chrome.send('getMostVisited'); chrome.send('getRecentlyClosedTabs'); -chrome.send('getTips'); chrome.send('getApps'); registerCallback('mostVisitedPages'); registerCallback('recentlyClosedTabs'); registerCallback('syncMessageChanged'); -registerCallback('tips'); -registerCallback('onHomePageSet'); registerCallback('getAppsCallback'); registerCallback('setShownSections'); @@ -72,7 +69,7 @@ var Section = { THUMB: 1, // LIST is no longer used RECENT: 4, - TIPS: 8, + // TIPS is no longer used SYNC: 16, DEBUG: 32 }; @@ -129,13 +126,11 @@ if ('mode' in hashParams) { <div id="main"> <div id=top-bar> - <div id="tip-line" class="section" section="TIPS"></div> <input type="button" id="option-button" i18n-values="title:pagedisplaytooltip"> </div> <menu id="option-menu"> - <div command="hide" section="TIPS" i18n-content="tips"></div> <div command="hide" section="THUMB" i18n-content="mostvisited"></div> <div command="hide" section="RECENT" i18n-content="recentlyclosed"></div> <hr> @@ -178,7 +173,6 @@ if ('mode' in hashParams) { </div> <script> - updateSimpleSection('tip-line', Section.TIPS); updateSimpleSection('recently-closed', Section.RECENT); updateSimpleSection('most-visited-section', Section.THUMB); updateSimpleSection('debug', Section.DEBUG); diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 5728d58..b9404a6 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -11,48 +11,6 @@ function updateSimpleSection(id, section) { $(id).classList.add('hidden'); } -var tipCache = {}; - -function tips(data) { - logEvent('received tips'); - tipCache = data; - renderTip(); -} - -function createTip(data) { - if (data.length) { - if (data[0].set_homepage_tip) { - var homepageButton = document.createElement('button'); - homepageButton.className = 'link'; - homepageButton.textContent = data[0].set_homepage_tip; - homepageButton.addEventListener('click', setAsHomePageLinkClicked); - return homepageButton; - } else { - try { - return parseHtmlSubset(data[0].tip_html_text); - } catch (parseErr) { - console.error('Error parsing tips: ' + parseErr.message); - } - } - } - // Return an empty DF in case of failure. - return document.createDocumentFragment(); -} - -function clearTipLine() { - var tipElement = $('tip-line'); - // There should always be only one tip. - tipElement.textContent = ''; - tipElement.removeEventListener('click', setAsHomePageLinkClicked); -} - -function renderTip() { - clearTipLine(); - var tipElement = $('tip-line'); - tipElement.appendChild(createTip(tipCache)); - fixLinkUnderlines(tipElement); -} - function recentlyClosedTabs(data) { logEvent('received recently closed tabs'); // We need to store the recent items so we can update the layout on a resize. @@ -847,17 +805,6 @@ function callGetSyncMessageIfSyncIsPresent() { } } -function setAsHomePageLinkClicked(e) { - chrome.send('setHomePage'); - e.preventDefault(); -} - -function onHomePageSet(data) { - showNotification(data[0], data[1]); - // Removes the "make this my home page" tip. - clearTipLine(); -} - function hideAllMenus() { optionMenu.hide(); } @@ -937,14 +884,3 @@ function mostVisitedPages(data, firstRun) { showFirstRunNotification(); } } - -// Log clicked links from the tips section. -document.addEventListener('click', function(e) { - var tipLinks = document.querySelectorAll('#tip-line a'); - for (var i = 0, tipLink; tipLink = tipLinks[i]; i++) { - if (tipLink.contains(e.target)) { - chrome.send('metrics', ['NTPTip_' + tipLink.href]); - break; - } - } -}); |