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 () { | |
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 * TODO(cstaley): Implement actual addition of new capture data | |
14 */ | |
15 this.saveCapture = function(name) { | |
16 console.log('Saving capture ' + name); | |
17 this.currentCaptures_.push(name); | |
18 } | |
19 | |
20 /** | |
21 * Return a list of currently stored captures in the local FileSystem. | |
22 * @return {Array.<!string>} Names of all the current captures. | |
23 * TODO(cstaley): Implement actual generation of current capture list via | |
24 * ls-like traversal of the extension's FileSystem. | |
25 */ | |
26 this.getCaptures = function() { | |
27 return this.currentCaptures_; | |
28 } | |
29 | |
30 /** | |
31 * Delete capture |name| from the local FileSystem, and update the | |
32 * capture choices HTML select element. | |
33 * @param {!string} name The name of the capture to delete. | |
34 * TODO(cstaley): Implement actual deletion | |
35 */ | |
36 this.deleteCapture = function(name) { | |
37 this.currentCaptures_.splice(this.currentCaptures_.indexOf(name), 1); | |
38 } | |
39 }; | |
OLD | NEW |