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/shared/js/cr/ui/table.js

Issue 10977032: Screen reader now reads the file manager selection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased. Created 8 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) 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 /** 5 /**
6 * @fileoverview This implements a table control. 6 * @fileoverview This implements a table control.
7 */ 7 */
8 8
9 cr.define('cr.ui', function() { 9 cr.define('cr.ui', function() {
10 /** @const */ var ListSelectionModel = cr.ui.ListSelectionModel; 10 /** @const */ var ListSelectionModel = cr.ui.ListSelectionModel;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 */ 161 */
162 setColumnWidth: function(index, width) { 162 setColumnWidth: function(index, width) {
163 this.columnWidths_[index] = width; 163 this.columnWidths_[index] = width;
164 }, 164 },
165 165
166 /** 166 /**
167 * Initializes the element. 167 * Initializes the element.
168 */ 168 */
169 decorate: function() { 169 decorate: function() {
170 this.list_ = this.ownerDocument.createElement('list'); 170 this.list_ = this.ownerDocument.createElement('list');
171 this.appendChild(this.list_);
171 TableList.decorate(this.list_); 172 TableList.decorate(this.list_);
172 this.list_.selectionModel = new ListSelectionModel(this); 173 this.list_.selectionModel = new ListSelectionModel(this);
173 this.list_.table = this; 174 this.list_.table = this;
174 175
175 this.header_ = this.ownerDocument.createElement('div'); 176 this.header_ = this.ownerDocument.createElement('div');
177 this.appendChild(this.header_);
James Hawkins 2012/10/01 02:12:56 Why did you make this change?
mtomasz 2012/10/01 02:50:55 We have to append the list to the DOM tree before
176 TableHeader.decorate(this.header_); 178 TableHeader.decorate(this.header_);
177 this.header_.table = this; 179 this.header_.table = this;
178 180
179 this.classList.add('table'); 181 this.classList.add('table');
180 this.appendChild(this.header_);
181 this.appendChild(this.list_);
182 this.ownerDocument.defaultView.addEventListener( 182 this.ownerDocument.defaultView.addEventListener(
183 'resize', this.header_.updateWidth.bind(this.header_)); 183 'resize', this.header_.updateWidth.bind(this.header_));
184 184
185 this.boundResize_ = this.resize.bind(this); 185 this.boundResize_ = this.resize.bind(this);
186 this.boundHandleSorted_ = this.handleSorted_.bind(this); 186 this.boundHandleSorted_ = this.handleSorted_.bind(this);
187 this.boundHandleChangeList_ = this.handleChangeList_.bind(this); 187 this.boundHandleChangeList_ = this.handleChangeList_.bind(this);
188 188
189 // The contained list should be focusable, not the table itself. 189 // The contained list should be focusable, not the table itself.
190 if (this.hasAttribute('tabindex')) { 190 if (this.hasAttribute('tabindex')) {
191 this.list_.setAttribute('tabindex', this.getAttribute('tabindex')); 191 this.list_.setAttribute('tabindex', this.getAttribute('tabindex'));
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 * because table contents can contain controls that can be focused, and for 321 * because table contents can contain controls that can be focused, and for
322 * some purposes (e.g., styling), the table can still be conceptually focused 322 * some purposes (e.g., styling), the table can still be conceptually focused
323 * at that point even though it doesn't actually have the page focus. 323 * at that point even though it doesn't actually have the page focus.
324 */ 324 */
325 cr.defineProperty(Table, 'hasElementFocus', cr.PropertyKind.BOOL_ATTR); 325 cr.defineProperty(Table, 'hasElementFocus', cr.PropertyKind.BOOL_ATTR);
326 326
327 return { 327 return {
328 Table: Table 328 Table: Table
329 }; 329 };
330 }); 330 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698