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

Side by Side Diff: chrome/browser/resources/ntp4/suggestions_page.js

Issue 10647003: Discovery API supports specifying a tile in a URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('ntp', function() { 5 cr.define('ntp', function() {
6 'use strict'; 6 'use strict';
7 7
8 var TilePage = ntp.TilePage; 8 var TilePage = ntp.TilePage;
9 9
10 /** 10 /**
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 var title = this.querySelector('.title'); 102 var title = this.querySelector('.title');
103 title.textContent = data.title; 103 title.textContent = data.title;
104 title.dir = data.direction; 104 title.dir = data.direction;
105 105
106 var score = this.querySelector('.score'); 106 var score = this.querySelector('.score');
107 score.textContent = data.score; 107 score.textContent = data.score;
108 108
109 // Sets the tooltip. 109 // Sets the tooltip.
110 this.title = data.title; 110 this.title = data.title;
111 111
112 var thumbnailUrl = 'chrome://thumb/' + data.url; 112 var thumbnailUrl;
113 thumbnailUrl = data.urlImage ? data.urlImage :
114 'chrome://thumb/' + data.url;
115
113 this.querySelector('.thumbnail').style.backgroundImage = 116 this.querySelector('.thumbnail').style.backgroundImage =
114 url(thumbnailUrl); 117 url(thumbnailUrl);
115 118
116 this.href = data.url; 119 this.href = data.url;
117 120
118 this.classList.remove('filler'); 121 this.classList.remove('filler');
119 }, 122 },
120 123
121 /** 124 /**
122 * Sets the color of the favicon dominant color bar. 125 * Sets the color of the favicon dominant color bar.
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 return oldData; 465 return oldData;
463 } 466 }
464 467
465 return { 468 return {
466 SuggestionsPage: SuggestionsPage, 469 SuggestionsPage: SuggestionsPage,
467 refreshData: refreshData, 470 refreshData: refreshData,
468 }; 471 };
469 }); 472 });
470 473
471 document.addEventListener('ntpLoaded', ntp.SuggestionsPage.onLoaded); 474 document.addEventListener('ntpLoaded', ntp.SuggestionsPage.onLoaded);
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/discovery/suggested_link.cc ('k') | chrome/browser/ui/webui/ntp/suggestions_source_discovery.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698