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

Side by Side Diff: chrome/test/data/extensions/platform_apps/app_icon/test.js

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: fix mac compile Created 3 years, 6 months 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 var panelWindow;
6 chrome.test.sendMessage("Launched"); 6 var nonShelfWindow;
7 // Create a panel window first 7 var shelfWindow;
8 chrome.app.window.create( 8
9 'main.html', { type: "panel" }, 9 function processNextCommand() {
10 function (win) { 10 chrome.test.sendMessage('ready', function(response) {
11 // Set the panel window icon 11 if (response == 'Exit') {
12 win.setIcon("icon64.png") 12 return;
13 }
14 if (response == 'createPanelWindow') {
15 chrome.app.window.create('main.html', { type: 'panel' }, function (win) {
16 panelWindow = win;
17 });
18 }
19 if (response == 'setPanelWindowIcon') {
20 panelWindow.setIcon('icon64.png')
21 }
22 if (response == 'createNonShelfWindow') {
13 // Create the shell window; it should use the app icon, and not affect 23 // Create the shell window; it should use the app icon, and not affect
14 // the panel icon. 24 // the panel icon.
15 chrome.app.window.create( 25 chrome.app.window.create(
16 'main.html', { type: "shell" }, 26 'main.html', { id: 'win',
27 type: 'shell' },
17 function (win) { 28 function (win) {
18 // Create the shell window which is shown in shelf; it should use 29 nonShelfWindow = win;
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 });
28 }); 30 });
29 }); 31 }
32 if (response == 'createShelfWindow') {
33 // Create the shell window which is shown in shelf; it should use
34 // another custom app icon.
35 chrome.app.window.create(
36 'main.html', { id: 'win_with_icon',
37 type: 'shell',
38 showInShelf: true },
39 function (win) {
40 shelfWindow = win;
41 });
42 }
43 if (response == 'setShelfWindowIcon') {
44 shelfWindow.setIcon('icon32.png')
45 }
46 processNextCommand();
47 });
48 };
49
50
51 chrome.app.runtime.onLaunched.addListener(function() {
52 chrome.test.sendMessage('Launched');
53 processNextCommand();
30 }); 54 });
55
OLDNEW
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698