Skip to content

Commit

Permalink
Merge pull request #78 from PaulKinlan/master
Browse files Browse the repository at this point in the history
Adding Permissions to the Chrome App Generator
  • Loading branch information
addyosmani committed Oct 4, 2012
2 parents 0657435 + 1929475 commit 632a59e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions lib/generators/chromeapp/all/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,19 @@ Generator.prototype.askFor = function askFor( argument ) {
warning: 'You can change the permissions'
},
{
name: 'cameraPermission',
name: 'browserTagPermission',
message: 'Would you like to use the Browser Tag in your app',
default: "Y/n",
warning: 'You can change the permissions'
},
{
name: 'videoCapturePermission',
message: 'Would you like to use the Camera in your app',
default: "Y/n",
warning: 'You can change the permissions'
},
{
name: 'audioPermission',
name: 'audioCapturePermission',
message: 'Would you like to use the Microphone in your app',
default: "Y/n",
warning: 'You can change the permissions'
Expand Down Expand Up @@ -109,7 +115,10 @@ Generator.prototype.askFor = function askFor( argument ) {
this.appPermissions.unlimitedStorage = (/y/i).test(props.unlimitedStoragePermission);
this.appPermissions.usb = (/y/i).test(props.usbPermission);
this.appPermissions.bluetooth = (/y/i).test(props.bluetoothPermission);

this.appPermissions.browserTag = (/y/i).test(props.browserTagPermission);
this.appPermissions.audioCapture = (/y/i).test(props.audioCapturePermission);
this.appPermissions.videoCapture = (/y/i).test(props.videoCapturePermission);

var connections = [];
if((/y/i).test(props.udpbindPermission)) connections.push("udp-bind::8899");
if((/y/i).test(props.udpsendPermission)) connections.push("udp-send-to::8899");
Expand All @@ -133,7 +142,8 @@ Generator.prototype.writeFiles = function createManifest() {
"bluetooth" : true,
"usb": true,
"identity": true,
"mediaGalleries": true
"mediaGalleries": true,
"browserTag": true
};


Expand Down

0 comments on commit 632a59e

Please sign in to comment.