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..4fe7207f46497870fd02d18b1d3f1591bbbe94a0 100644 |
--- a/chrome/browser/resources/hotword_audio_verification/event_page.js |
+++ b/chrome/browser/resources/hotword_audio_verification/event_page.js |
@@ -2,15 +2,21 @@ |
// 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. |
+ // TODO(kcarattini): Remove this when crbug/426725 is fixed. |
benwells
2014/10/24 04:34:17
I am guessing the window isn't shown as you've got
kcarattini
2014/10/25 02:54:26
Confirmed that the window isn't focused due to the
|
+ var appWindow = chrome.app.window.get(appId); |
+ if (appWindow) { |
+ appWindow.focus(); |
+ return; |
+ } |
- // 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 |