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 var WALLPAPER_PICKER_WIDTH = 576; | 5 var WALLPAPER_PICKER_WIDTH = 574; |
6 var WALLPAPER_PICKER_HEIGHT = 422; | 6 var WALLPAPER_PICKER_HEIGHT = 420; |
7 | 7 |
8 var wallpaperPickerWindow; | 8 var wallpaperPickerWindow; |
9 | 9 |
10 chrome.app.runtime.onLaunched.addListener(function() { | 10 chrome.app.runtime.onLaunched.addListener(function() { |
11 if (wallpaperPickerWindow && !wallpaperPickerWindow.contentWindow.closed) { | 11 if (wallpaperPickerWindow && !wallpaperPickerWindow.contentWindow.closed) { |
12 wallpaperPickerWindow.focus(); | 12 wallpaperPickerWindow.focus(); |
13 chrome.wallpaperPrivate.minimizeInactiveWindows(); | 13 chrome.wallpaperPrivate.minimizeInactiveWindows(); |
14 return; | 14 return; |
15 } | 15 } |
16 | 16 |
17 chrome.app.window.create('main.html', { | 17 chrome.app.window.create('main.html', { |
18 frame: 'none', | 18 frame: 'none', |
19 width: WALLPAPER_PICKER_WIDTH, | 19 width: WALLPAPER_PICKER_WIDTH, |
20 height: WALLPAPER_PICKER_HEIGHT, | 20 height: WALLPAPER_PICKER_HEIGHT, |
21 minWidth: WALLPAPER_PICKER_WIDTH, | 21 minWidth: WALLPAPER_PICKER_WIDTH, |
22 maxWidth: WALLPAPER_PICKER_WIDTH, | 22 maxWidth: WALLPAPER_PICKER_WIDTH, |
23 minHeight: WALLPAPER_PICKER_HEIGHT, | 23 minHeight: WALLPAPER_PICKER_HEIGHT, |
24 maxHeight: WALLPAPER_PICKER_HEIGHT, | 24 maxHeight: WALLPAPER_PICKER_HEIGHT, |
25 transparentBackground: true | 25 transparentBackground: true |
26 }, function(w) { | 26 }, function(w) { |
27 wallpaperPickerWindow = w; | 27 wallpaperPickerWindow = w; |
28 chrome.wallpaperPrivate.minimizeInactiveWindows(); | 28 chrome.wallpaperPrivate.minimizeInactiveWindows(); |
29 w.onClosed.addListener(function() { | 29 w.onClosed.addListener(function() { |
30 chrome.wallpaperPrivate.restoreMinimizedWindows(); | 30 chrome.wallpaperPrivate.restoreMinimizedWindows(); |
31 }); | 31 }); |
32 }); | 32 }); |
33 }); | 33 }); |
OLD | NEW |