OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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.onLaunched.addListener(function() { | 5 chrome.app.runtime.onLaunched.addListener(function() { |
6 chrome.test.sendMessage("Launched"); | 6 chrome.test.sendMessage("Launched"); |
7 // Create a panel window first | 7 // Create a panel window first |
8 chrome.app.window.create( | 8 chrome.app.window.create( |
9 'main.html', { type: "panel" }, | 9 'main.html', { type: "panel" }, |
10 function (win) { | 10 function (win) { |
11 // Set the panel window icon | 11 // Set the panel window icon |
12 win.setIcon("icon64.png") | 12 win.setIcon("icon64.png") |
13 // Create the shell window; it should use the app icon, and not affect | 13 // Create the shell window; it should use the app icon, and not affect |
14 // the panel icon. | 14 // the panel icon. |
15 chrome.app.window.create( | 15 chrome.app.window.create( |
16 'main.html', { type: "shell" }, | 16 'main.html', { type: "shell" }, |
17 function (win) { | 17 function (win) { |
18 chrome.test.sendMessage("Completed"); | 18 // Create the shell window which is shown in shelf; it should use |
| 19 // another custom app icon. |
| 20 chrome.app.window.create( |
| 21 'main.html', { id: "win_with_icon", |
| 22 type: "shell", |
| 23 icon: "icon48.png", |
| 24 showInShelf: true }, |
| 25 function (win) { |
| 26 chrome.test.sendMessage("Completed"); |
| 27 }); |
19 }); | 28 }); |
20 }); | 29 }); |
21 }); | 30 }); |
OLD | NEW |