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

Side by Side Diff: chrome/browser/resources/history/other_devices.js

Issue 668983004: Add <a is="action-link">, a web component extension of <a> for in-page actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 /** 5 /**
6 * @fileoverview The section of the history page that shows tabs from sessions 6 * @fileoverview The section of the history page that shows tabs from sessions
7 on other devices. 7 on other devices.
8 */ 8 */
9 9
10 /////////////////////////////////////////////////////////////////////////////// 10 ///////////////////////////////////////////////////////////////////////////////
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 String(win.sessionId), 286 String(win.sessionId),
287 String(tab.sessionId))); 287 String(tab.sessionId)));
288 contents.appendChild(a); 288 contents.appendChild(a);
289 } else { 289 } else {
290 numTabsHidden++; 290 numTabsHidden++;
291 } 291 }
292 } 292 }
293 } 293 }
294 294
295 if (numTabsHidden > 0) { 295 if (numTabsHidden > 0) {
296 var moreLinkButton = createElementWithClassName('button', 296 var moreLink = document.createElement('a', 'action-link');
297 'device-show-more-tabs link-button'); 297 moreLink.classList.add('device-show-more-tabs');
298 moreLinkButton.addEventListener('click', this.view_.increaseRowHeight.bind( 298 moreLink.addEventListener('click', this.view_.increaseRowHeight.bind(
299 this.view_, this.row_, numTabsHidden)); 299 this.view_, this.row_, numTabsHidden));
300 var xMore = loadTimeData.getString('xMore'); 300 moreLink.textContent = loadTimeData.getStringF('xMore', numTabsHidden);
301 moreLinkButton.appendChild( 301 contents.appendChild(moreLink);
302 document.createTextNode(xMore.replace('$1', numTabsHidden)));
303 contents.appendChild(moreLinkButton);
304 } 302 }
305 303
306 return contents; 304 return contents;
307 }; 305 };
308 306
309 /** 307 /**
310 * Add child text nodes to a node such that occurrences of this.searchText_ are 308 * Add child text nodes to a node such that occurrences of this.searchText_ are
311 * highlighted. 309 * highlighted.
312 * @param {Node} node The node under which new text nodes will be made as 310 * @param {Node} node The node under which new text nodes will be made as
313 * children. 311 * children.
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 548
551 var doSearch = function(e) { 549 var doSearch = function(e) {
552 devicesView.setSearchText($('search-field').value); 550 devicesView.setSearchText($('search-field').value);
553 }; 551 };
554 $('search-field').addEventListener('search', doSearch); 552 $('search-field').addEventListener('search', doSearch);
555 $('search-button').addEventListener('click', doSearch); 553 $('search-button').addEventListener('click', doSearch);
556 } 554 }
557 555
558 // Add handlers to HTML elements. 556 // Add handlers to HTML elements.
559 document.addEventListener('DOMContentLoaded', load); 557 document.addEventListener('DOMContentLoaded', load);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698