Bug 950241 - Add update restart flag to metro utils. r=bbondy, a=lsblakk
authorJim Mathies <jmathies@mozilla.com>
Thu, 30 Jan 2014 13:32:47 -0600
changeset 176256 6673ba8dfffd4064862672089aeb16cef74189a2
parent 176255 a1e4675ef6808e6141a18579de5878ad489a826e
child 176257 5e595adf2d9e5793f41466e997bf5ac6ffc6316f
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy, lsblakk
bugs950241
milestone28.0
Bug 950241 - Add update restart flag to metro utils. r=bbondy, a=lsblakk
widget/nsIWinMetroUtils.idl
widget/windows/winrt/nsWinMetroUtils.cpp
widget/windows/winrt/nsWinMetroUtils.h
--- a/widget/nsIWinMetroUtils.idl
+++ b/widget/nsIWinMetroUtils.idl
@@ -7,17 +7,17 @@
 
 /**
  * Integration with the "Metro"/"Modern" UI environment in Windows 8.
  *
  * Note: browser/metro/base/content/browser-scripts.js contains a stub
  * implementation of this interface for non-Windows systems, for testing and
  * development purposes only.
  */
-[scriptable, uuid(148f57d3-51df-4e5c-a40b-7ae5ee76188e)]
+[scriptable, uuid(b6cbef4a-eec1-470b-8e74-9f4120f678c6)]
 interface nsIWinMetroUtils : nsISupports
 {
   /**
    * Determine if the current browser is running in the metro immersive
    * environment.
    */
   readonly attribute boolean immersive;
 
@@ -28,16 +28,23 @@ interface nsIWinMetroUtils : nsISupports
 
   /**
    * Determine the previous execution state. The possible values of this
    * attribute are exactly those values in the
    * Windows::ApplicationModel::Activation enumeration.
    */
   readonly attribute long previousExecutionState;
 
+  /**
+   * Helper for our restart logic up in the about flyout. We set this
+   * right before we restart for an update so that MetroAppShell can
+   * communicate this to the ceh.
+   */
+  attribute boolean updatePending;
+
    /**
     * Show the settings flyout
     */
    void showSettingsFlyout();
 
   /**
    * Launches the specified application with the specified arguments and
    * switches to Desktop mode if in metro mode.
--- a/widget/windows/winrt/nsWinMetroUtils.cpp
+++ b/widget/windows/winrt/nsWinMetroUtils.cpp
@@ -28,16 +28,18 @@ namespace winrt {
 extern ComPtr<MetroApp> sMetroApp;
 extern nsTArray<nsString>* sSettingsArray;
 extern ComPtr<FrameworkView> sFrameworkView;
 } } }
 
 namespace mozilla {
 namespace widget {
 
+bool nsWinMetroUtils::sUpdatePending = false;
+
 NS_IMPL_ISUPPORTS1(nsWinMetroUtils, nsIWinMetroUtils)
 
 nsWinMetroUtils::nsWinMetroUtils()
 {
 }
 
 nsWinMetroUtils::~nsWinMetroUtils()
 {
@@ -312,10 +314,24 @@ nsWinMetroUtils::AddSettingsPanelEntry(c
 
 NS_IMETHODIMP
 nsWinMetroUtils::SwapMouseButton(bool aValue, bool *aOriginalValue)
 {
   *aOriginalValue = ::SwapMouseButton(aValue);
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsWinMetroUtils::GetUpdatePending(bool *aUpdatePending)
+{
+  *aUpdatePending = sUpdatePending;
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsWinMetroUtils::SetUpdatePending(bool aUpdatePending)
+{
+  sUpdatePending = aUpdatePending;
+  return NS_OK;
+}
+
 } // widget
 } // mozilla
--- a/widget/windows/winrt/nsWinMetroUtils.h
+++ b/widget/windows/winrt/nsWinMetroUtils.h
@@ -14,12 +14,14 @@ namespace widget {
 class nsWinMetroUtils : public nsIWinMetroUtils
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIWINMETROUTILS
 
   nsWinMetroUtils();
   virtual ~nsWinMetroUtils();
+
+  static bool sUpdatePending;
 };
 
 } // widget
 } // mozilla