Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1766)

Unified Diff: chrome/browser/resources/new_new_tab.js

Issue 3033032: Remove tips from NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_new_tab.js
===================================================================
--- chrome/browser/resources/new_new_tab.js (revision 53888)
+++ chrome/browser/resources/new_new_tab.js (working copy)
@@ -11,48 +11,6 @@
$(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 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 @@
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;
- }
- }
-});
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698