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

Unified Diff: chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js

Issue 11028121: Convert wallpaper picker to v2 app (Closed) Base URL: http://git.chromium.org/chromium/src.git@AppsV2
Patch Set: add the list of previous minimized window to new window state manager Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
diff --git a/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
new file mode 100644
index 0000000000000000000000000000000000000000..fbf32faddd9db0a06513925a16118a73c9b80d07
--- /dev/null
+++ b/chrome/browser/resources/chromeos/wallpaper_manager/js/event_page.js
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var WALLPAPER_PICKER_WIDTH = 550;
+var WALLPAPER_PICKER_HEIGHT = 420;
+
+var wallpaperPickerWindow;
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ if (wallpaperPickerWindow && !wallpaperPickerWindow.contentWindow.closed) {
+ wallpaperPickerWindow.focus();
+ chrome.wallpaperPrivate.minimizeInactiveWindows();
+ return;
+ }
+
+ chrome.app.window.create('main.html', {
+ frame: 'chrome',
+ width: WALLPAPER_PICKER_WIDTH,
+ height: WALLPAPER_PICKER_HEIGHT
+ }, function(w) {
+ wallpaperPickerWindow = w;
+ chrome.wallpaperPrivate.minimizeInactiveWindows();
+ w.onClosed.addListener(function() {
+ chrome.wallpaperPrivate.restoreMinimizedWindows();
+ });
+ });
+});

Powered by Google App Engine
This is Rietveld 408576698