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

Side by Side Diff: native_client_sdk/src/examples/tutorial/filesystem_passing/example.js

Issue 690403002: [NaCl SDK] Add filesystem passing example. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix verify Created 6 years, 1 month 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
(Empty)
1 // Copyright (c) 2014 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 function attachListeners() {
6 document.getElementById('choosedir').addEventListener('click', function(e) {
7 chrome.fileSystem.chooseEntry({type: 'openDirectory'}, function(entry) {
8 if (!entry) {
9 // The user cancelled the dialog.
10 return;
11 }
12
13 // Send the filesystem and the directory path to the NaCl module.
14 common.naclModule.postMessage({
15 filesystem: entry.filesystem,
16 fullPath: entry.fullPath
17 });
18 });
19 }, false);
20 }
21
22 // Called by the common.js module.
23 function moduleDidLoad() {
24 // The module is not hidden by default so we can easily see if the plugin
25 // failed to load.
26 common.hideModule();
27
28 // Make sure this example is running as an App. If not, display a warning.
29 if (!chrome.fileSystem) {
30 common.updateStatus('Error: must be run as an App.');
31 return;
32 }
33 }
34
35 // Called by the common.js module.
36 function handleMessage(message_event) {
37 common.logMessage(message_event.data);
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698