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

Unified Diff: chrome/browser/resources/hotword_audio_verification/event_page.js

Issue 671333002: Hotword Audio Verification App: Fix window handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove debugging code Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/hotword_audio_verification/flow.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/hotword_audio_verification/event_page.js
diff --git a/chrome/browser/resources/hotword_audio_verification/event_page.js b/chrome/browser/resources/hotword_audio_verification/event_page.js
index ad421b3430bc5d725b5212775a80c776ea145844..b98ff086ba7811586c146974715bcc171df9f72c 100644
--- a/chrome/browser/resources/hotword_audio_verification/event_page.js
+++ b/chrome/browser/resources/hotword_audio_verification/event_page.js
@@ -2,15 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+var appId = 'hotword_audio_verification_app';
+
chrome.app.runtime.onLaunched.addListener(function() {
- // TODO(kcarattini): Check if the app is already running. If so, bring it
- // to focus rather than creating a new window.
+ var appWindow = chrome.app.window.get(appId);
+ if (appWindow) {
+ appWindow.focus();
+ return;
+ }
Dan Beam 2014/10/24 00:31:48 seems like this should already happen[1]: """ If
kcarattini 2014/10/24 00:35:27 When I tested, the window did not focus, that's wh
kcarattini 2014/10/24 02:28:35 Issue https://code.google.com/p/chromium/issues/de
- // TODO(kcarattini): Don't show the window until the launch mode has been
- // established.
chrome.app.window.create('main.html', {
'frame': 'none',
'resizable': false,
+ 'hidden': true,
+ 'id': appId,
'bounds': {
'width': 800,
'height': 600
« no previous file with comments | « no previous file | chrome/browser/resources/hotword_audio_verification/flow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698