| OLD | NEW |
| 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 /** @constructor */ | 5 /** @constructor */ |
| 6 function TaskManager() { } | 6 function TaskManager() { } |
| 7 | 7 |
| 8 cr.addSingletonGetter(TaskManager); | 8 cr.addSingletonGetter(TaskManager); |
| 9 | 9 |
| 10 /* | 10 /* |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 item.setAttributeNode(this.document_.createAttribute("checked")); | 258 item.setAttributeNode(this.document_.createAttribute("checked")); |
| 259 this.columnSelectContextMenu_.appendChild(item); | 259 this.columnSelectContextMenu_.appendChild(item); |
| 260 } | 260 } |
| 261 | 261 |
| 262 this.document_.body.appendChild(this.columnSelectContextMenu_); | 262 this.document_.body.appendChild(this.columnSelectContextMenu_); |
| 263 cr.ui.Menu.decorate(this.columnSelectContextMenu_); | 263 cr.ui.Menu.decorate(this.columnSelectContextMenu_); |
| 264 | 264 |
| 265 cr.ui.contextMenuHandler.addContextMenuProperty(this.table_.header); | 265 cr.ui.contextMenuHandler.addContextMenuProperty(this.table_.header); |
| 266 this.table_.header.contextMenu = this.columnSelectContextMenu_; | 266 this.table_.header.contextMenu = this.columnSelectContextMenu_; |
| 267 | 267 |
| 268 cr.ui.contextMenuHandler.addContextMenuProperty(this.table_.list); |
| 269 this.table_.list.contextMenu = this.columnSelectContextMenu_; |
| 270 |
| 268 this.document_.addEventListener('command', this.onCommand_.bind(this)); | 271 this.document_.addEventListener('command', this.onCommand_.bind(this)); |
| 269 this.document_.addEventListener('canExecute', | 272 this.document_.addEventListener('canExecute', |
| 270 this.onCommandCanExecute_.bind(this)); | 273 this.onCommandCanExecute_.bind(this)); |
| 271 | 274 |
| 272 }, | 275 }, |
| 273 | 276 |
| 274 initTableMenu_: function () { | 277 initTableMenu_: function () { |
| 275 this.table_menu_commands_ = []; | 278 this.table_menu_commands_ = []; |
| 276 this.tableContextMenu_ = this.document_.createElement('menu'); | 279 this.tableContextMenu_ = this.document_.createElement('menu'); |
| 277 | 280 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 taskmanager.onTaskChange(start, length, tasks); | 559 taskmanager.onTaskChange(start, length, tasks); |
| 557 } | 560 } |
| 558 | 561 |
| 559 function taskRemoved(start, length) { | 562 function taskRemoved(start, length) { |
| 560 // Sometimes this can get called too early. | 563 // Sometimes this can get called too early. |
| 561 if (!taskmanager) | 564 if (!taskmanager) |
| 562 return; | 565 return; |
| 563 taskmanager.onTaskRemove(start, length); | 566 taskmanager.onTaskRemove(start, length); |
| 564 } | 567 } |
| 565 | 568 |
| OLD | NEW |