OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 chrome.app.runtime.onEmbedRequested.addListener(function(request) { | 5 chrome.app.runtime.onEmbedRequested.addListener(function(request) { |
6 if (!request.embedderId) | 6 if (!request.embedderId) |
7 request.deny(); | 7 request.deny(); |
8 if (!request.data.foo) { | 8 if (!request.data.foo) { |
9 request.allow('main.html'); | 9 request.allow('main.html'); |
10 return; | 10 return; |
11 } else if (request.data.foo == 'bar') { | 11 } else if (request.data.foo == 'bar') { |
12 request.deny(); | 12 request.deny(); |
13 } else if (request.data.foo == 'bleep') { | 13 } else if (request.data.foo == 'bleep') { |
14 request.allow('main.html'); | 14 request.allow('main.html'); |
15 } | 15 } |
16 }); | 16 }); |
17 | 17 |
OLD | NEW |