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

Side by Side Diff: chrome/browser/resources/hterm/js/mock_row_provider.js

Issue 8680034: Initial landing of Screen, Terminal, and VT100 classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 function MockRowProvider(document, count) { 5 function MockRowProvider(document, count) {
6 this.document_ = document; 6 this.document_ = document;
7 this.rows_ = new Array(); 7 this.rows_ = new Array();
8 this.rows_.length = count; 8 this.rows_.length = count;
9 9
10 this.rowNodeCache_ = null; 10 this.rowNodeCache_ = null;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return rec.text; 77 return rec.text;
78 }; 78 };
79 79
80 MockRowProvider.prototype.getRowNode = function(index) { 80 MockRowProvider.prototype.getRowNode = function(index) {
81 this.addCallCount('getRowNode'); 81 this.addCallCount('getRowNode');
82 82
83 if (this.rowNodeCache_ && index in this.rowNodeCache_) 83 if (this.rowNodeCache_ && index in this.rowNodeCache_)
84 return this.rowNodeCache_[index]; 84 return this.rowNodeCache_[index];
85 85
86 var rec = this.getRowRecord_(index); 86 var rec = this.getRowRecord_(index);
87 var rowNode = this.document_.createElement('div'); 87 var rowNode = this.document_.createElement('x-row');
88 rowNode.rowIndex = index; 88 rowNode.rowIndex = index;
89 rowNode.innerHTML = rec.html; 89 rowNode.innerHTML = rec.html;
90 90
91 if (this.rowNodeCache_) 91 if (this.rowNodeCache_)
92 this.rowNodeCache_[index] = rowNode; 92 this.rowNodeCache_[index] = rowNode;
93 93
94 return rowNode; 94 return rowNode;
95 }; 95 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698