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

Side by Side Diff: chrome/browser/resources/bluetooth_internals/device_collection.js

Issue 2568283003: bluetooth: Add notification system to internals page. (Closed)
Patch Set: Remove margin, fix bug where snackbar dismisses if shown with no focus Created 3 years, 12 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * Javascript for DeviceCollection, served from 6 * Javascript for DeviceCollection, served from
7 * chrome://bluetooth-internals/. 7 * chrome://bluetooth-internals/.
8 */ 8 */
9 9
10 cr.define('device_collection', function() { 10 cr.define('device_collection', function() {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 remove: function(deviceInfo) { 80 remove: function(deviceInfo) {
81 var device = this.getByAddress(deviceInfo.address); 81 var device = this.getByAddress(deviceInfo.address);
82 assert(device, 'Device does not exist.'); 82 assert(device, 'Device does not exist.');
83 device.removed = true; 83 device.removed = true;
84 this.updateIndex(this.indexOf(device)); 84 this.updateIndex(this.indexOf(device));
85 }, 85 },
86 86
87 /** 87 /**
88 * Updates the device connection status. 88 * Updates the device connection status.
89 * @param {string} address The address of the device. 89 * @param {string} address The address of the device.
90 * @param {number} status . 90 * @param {number} status The new connection status.
91 * @param {?Error} opt_error Optional Error from connection.
92 */ 91 */
93 updateConnectionStatus: function(address, status, opt_error) { 92 updateConnectionStatus: function(address, status, opt_error) {
94 var message = (opt_error && opt_error.message) || '';
95
96 var device = assert(this.getByAddress(address), 'Device does not exist'); 93 var device = assert(this.getByAddress(address), 'Device does not exist');
97 device.connectionStatus = status; 94 device.connectionStatus = status;
98
99 // TODO(crbug.com/663830): Replace connection error column with better
100 // notification system.
101 device.connectionMessage = message;
102 this.updateIndex(this.indexOf(device)); 95 this.updateIndex(this.indexOf(device));
103 }, 96 },
104 }; 97 };
105 98
106 return { 99 return {
107 ConnectionStatus: ConnectionStatus, 100 ConnectionStatus: ConnectionStatus,
108 DeviceCollection: DeviceCollection, 101 DeviceCollection: DeviceCollection,
109 }; 102 };
110 }); 103 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698