Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 var CyclerData = function () { | |
|
Jeffrey Yasskin
2012/08/15 01:03:59
I assume you plan to save this object to some sort
clintstaley
2012/08/15 23:54:20
Not the object, but the FileSystem it will use wil
Jeffrey Yasskin
2012/08/16 20:19:31
Ah, so it'll do the equivalent of an `ls` to popul
clintstaley
2012/08/17 04:12:25
Yeah, I found it took a little getting used to too
| |
| 6 this.currentCaptures_ = ['alpha', 'beta', 'gamma']; | |
| 7 | |
| 8 /** | |
| 9 * Mark a capture as saved successfully. Actual writing of the cache | |
| 10 * directory and URL list into the FileSystem is done from the C++ side. | |
| 11 * JS side just updates the capture choices. | |
| 12 * @param {!string} name The name of the capture. | |
| 13 */ | |
| 14 this.saveCapture = function(name) { | |
| 15 console.log('Saving capture ' + name); | |
| 16 this.currentCaptures_.push(name); | |
| 17 } | |
| 18 | |
| 19 /** | |
| 20 * Return a list of currently stored captures in the local FileSystem. | |
| 21 * @return {Array.<!string>} Names of all the current captures. | |
| 22 */ | |
| 23 this.getCaptures = function() { | |
| 24 return this.currentCaptures_; | |
| 25 } | |
| 26 | |
| 27 /** | |
| 28 * Delete capture |name| from the local FileSystem, and update the | |
|
Jeffrey Yasskin
2012/08/15 01:03:59
Please mark the actual deletion as a TODO.
clintstaley
2012/08/15 23:54:20
Done, here and on the other two TODO methods as we
| |
| 29 * capture choices HTML select element. | |
| 30 * @param {!string} name The name of the capture to delete. | |
| 31 */ | |
| 32 this.deleteCapture = function(name) { | |
| 33 this.currentCaptures_.splice(this.currentCaptures_.indexOf(name), 1); | |
| 34 } | |
| 35 }; | |
| OLD | NEW |