OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 function sendLaunchedAndRunReply() { |
| 6 chrome.test.sendMessage('Launched', function (reply) { |
| 7 if (reply) |
| 8 window[reply](); |
| 9 }); |
| 10 } |
| 11 |
| 12 function createHidden() { |
| 13 chrome.app.window.create('empty.html', { |
| 14 id: 'hidden_with_id', |
| 15 hidden: true, |
| 16 }, function () { |
| 17 sendLaunchedAndRunReply(); |
| 18 }); |
| 19 } |
| 20 |
| 21 function createVisible() { |
| 22 chrome.app.window.create('empty.html', { |
| 23 id: 'hidden_with_id', |
| 24 }, function () { |
| 25 sendLaunchedAndRunReply(); |
| 26 }); |
| 27 } |
| 28 |
| 29 chrome.app.runtime.onLaunched.addListener(function() { |
| 30 sendLaunchedAndRunReply(); |
| 31 }); |
OLD | NEW |