Bug 662623 - If open, show the locale picker window when returning from background. r=mbrubeck
authorWes Johnston <wjohnston@mozilla.com>
Wed, 29 Jun 2011 14:48:38 -0700
changeset 72046 3d354c476890220c5dc3259494efe1c5163d2bae
parent 72045 ee430647729b8af4e356608a709babb5ce1e4ec5
child 72047 95f6f9fcb15d8e49a6db37d1f37e10077fd8069c
push id20648
push usermak77@bonardo.net
push dateThu, 30 Jun 2011 10:55:29 +0000
treeherdermozilla-central@5c246f2bccb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs662623
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 662623 - If open, show the locale picker window when returning from background. r=mbrubeck
mobile/chrome/content/localePicker.xul
mobile/components/BrowserCLH.js
--- a/mobile/chrome/content/localePicker.xul
+++ b/mobile/chrome/content/localePicker.xul
@@ -1,15 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/platform.css" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/localePicker.css" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="start();"
+        windowtype="navigator:localepicker"
         width="480"
         height="800">
   <script src="chrome://browser/content/Util.js" type="application/javascript;version=1.8"/>
   <script src="chrome://browser/content/input.js" type="application/javascript;version=1.8"/>
   <script src="chrome://browser/content/localePicker.js" type="application/javascript;version=1.8"/>
   <deck id="language-deck" flex="1">
     <vbox id="main-page" class="pane" flex="1">
       <spacer flex="1"/>
--- a/mobile/components/BrowserCLH.js
+++ b/mobile/components/BrowserCLH.js
@@ -183,19 +183,25 @@ BrowserCLH.prototype = {
 
       let uri = resolveURIInternal(aCmdLine, arg);
       if (uri)
         uris.push(uri);
     }
 
     // Open the main browser window, if we don't already have one
     let win;
+    let localePickerWin;
     try {
       win = Services.wm.getMostRecentWindow("navigator:browser");
-      if (!win) {
+      localePickerWin = Services.wm.getMostRecentWindow("navigator:localepicker");
+      if (localePickerWin) {
+        localePickerWin.focus();
+        aCmdLine.preventDefault = true;
+        return;
+      } else  if (!win) {
         // Default to the saved homepage
         let defaultURL = getHomePage();
 
         // Override the default if we have a URL passed on command line
         if (uris.length > 0) {
           defaultURL = uris[0].spec;
           uris = uris.slice(1);
         }