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

Side by Side Diff: chrome/browser/resources/file_manager/background/js/progress_center.js

Issue 131403003: Files.app: Show drive sync state in the progress center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-upload Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Progress center at the background page. 8 * Progress center at the background page.
9 * @constructor 9 * @constructor
10 */ 10 */
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Create/update the notification with the item. 121 // Create/update the notification with the item.
122 this.queue_.run(function(proceed) { 122 this.queue_.run(function(proceed) {
123 var params = { 123 var params = {
124 title: chrome.runtime.getManifest().name, 124 title: chrome.runtime.getManifest().name,
125 iconUrl: chrome.runtime.getURL('/common/images/icon96.png'), 125 iconUrl: chrome.runtime.getURL('/common/images/icon96.png'),
126 type: item.state === ProgressItemState.PROGRESSING ? 'progress' : 'basic', 126 type: item.state === ProgressItemState.PROGRESSING ? 'progress' : 'basic',
127 message: item.message, 127 message: item.message,
128 buttons: item.cancelable ? [{title: str('CANCEL_LABEL')}] : undefined, 128 buttons: item.cancelable ? [{title: str('CANCEL_LABEL')}] : undefined,
129 progress: item.state === ProgressItemState.PROGRESSING ? 129 progress: item.state === ProgressItemState.PROGRESSING ?
130 item.progressRateByPercent : undefined 130 item.progressRateInPercent : undefined,
131 priority: (item.state === ProgressItemState.ERROR || !item.quiet) ? 0 : -1
131 }; 132 };
132 if (newlyAdded) 133 if (newlyAdded)
133 chrome.notifications.create(item.id, params, proceed); 134 chrome.notifications.create(item.id, params, proceed);
134 else 135 else
135 chrome.notifications.update(item.id, params, proceed); 136 chrome.notifications.update(item.id, params, proceed);
136 }.bind(this)); 137 }.bind(this));
137 }; 138 };
138 139
139 /** 140 /**
140 * Handles cancel button click. 141 * Handles cancel button click.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 * @return {number} Item index. Returns -1 If the item is not found. 249 * @return {number} Item index. Returns -1 If the item is not found.
249 * @private 250 * @private
250 */ 251 */
251 ProgressCenter.prototype.getItemIndex_ = function(id) { 252 ProgressCenter.prototype.getItemIndex_ = function(id) {
252 for (var i = 0; i < this.items_.length; i++) { 253 for (var i = 0; i < this.items_.length; i++) {
253 if (this.items_[i].id === id) 254 if (this.items_[i].id === id)
254 return i; 255 return i;
255 } 256 }
256 return -1; 257 return -1;
257 }; 258 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698