merge fx-team to m-c
authorWes Kocher <wkocher@mozilla.com>
Fri, 06 Dec 2013 20:45:11 -0600
changeset 175002 0e7592478aa504a9c53db721e1f5542c26823b6c
parent 174997 2099f78b7deaa46274cbb90db960629e8fba1a3b (current diff)
parent 175001 05643bb0c75e5fa3bd3d475375d6d28de87b2044 (diff)
child 175003 42b2a2adda8f06fb27ad90c2feff962403a34c1c
child 175018 9765cb37859d228781ddf926382d643c0c513944
child 175038 2e99286e1e732b5a5d58401fb4b869946c39b5b1
child 175098 8e360beb1c65a29f3a87494fe1de2e7d34f326a3
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)
milestone28.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
merge fx-team to m-c
--- a/browser/metro/shell/commandexecutehandler/CEHHelper.cpp
+++ b/browser/metro/shell/commandexecutehandler/CEHHelper.cpp
@@ -7,16 +7,17 @@
 #include <tlhelp32.h>
 
 #ifdef SHOW_CONSOLE
 #include <io.h> // _open_osfhandle
 #endif
 
 HANDLE sCon;
 LPCWSTR metroDX10Available = L"MetroD3DAvailable";
+LPCWSTR metroLastAHE = L"MetroLastAHE";
 
 typedef HRESULT (WINAPI*D3D10CreateDevice1Func)
   (IDXGIAdapter *, D3D10_DRIVER_TYPE, HMODULE, UINT,
    D3D10_FEATURE_LEVEL1, UINT, ID3D10Device1 **);
 typedef HRESULT(WINAPI*CreateDXGIFactory1Func)(REFIID , void **);
 
 void
 Log(const wchar_t *fmt, ...)
@@ -102,16 +103,33 @@ IsProcessRunning(const wchar_t *processN
       }
     }
   }
 
   CloseHandle(snapshot);
   return exists;
 }
 
+
+AHE_TYPE
+GetLastAHE()
+{
+  DWORD ahe;
+  if (GetDWORDRegKey(metroLastAHE, ahe)) {
+    return (AHE_TYPE) ahe;
+  }
+  return AHE_DESKTOP;
+}
+
+bool
+SetLastAHE(AHE_TYPE ahe)
+{
+  return SetDWORDRegKey(metroLastAHE, (DWORD) ahe);
+}
+
 bool
 IsDX10Available()
 {
   DWORD isDX10Available;
   if (GetDWORDRegKey(metroDX10Available, isDX10Available)) {
     return isDX10Available;
   }
 
--- a/browser/metro/shell/commandexecutehandler/CEHHelper.h
+++ b/browser/metro/shell/commandexecutehandler/CEHHelper.h
@@ -8,24 +8,27 @@
 #define WINVER 0x602
 #define _WIN32_WINNT 0x602
 
 #include <windows.h>
 #include <d3d10_1.h>
 #include <dxgi.h>
 #include <d3d10misc.h>
 #include <atlbase.h>
+#include <shlobj.h>
 
 //#define SHOW_CONSOLE 1
 extern HANDLE sCon;
 extern LPCWSTR metroDX10Available;
 
 void Log(const wchar_t *fmt, ...);
 
 #if defined(SHOW_CONSOLE)
 void SetupConsole();
 #endif
 
+AHE_TYPE GetLastAHE();
+bool SetLastAHE(AHE_TYPE ahe);
 bool IsDX10Available();
 bool GetDWORDRegKey(LPCWSTR name, DWORD &value);
 bool SetDWORDRegKey(LPCWSTR name, DWORD value);
 bool IsImmersiveProcessDynamic(HANDLE process);
 bool IsProcessRunning(const wchar_t *processName, bool bCheckIfMetro);
--- a/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
+++ b/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp
@@ -257,89 +257,60 @@ public:
     *aInt = nullptr;
     return mUnkSite ? mUnkSite->QueryInterface(aRefID, aInt) : E_FAIL;
   }
 
   // IExecuteCommandApplicationHostEnvironment
   IFACEMETHODIMP GetValue(AHE_TYPE *aLaunchType)
   {
     Log(L"IExecuteCommandApplicationHostEnvironment::GetValue()");
-    *aLaunchType = AHE_DESKTOP;
-    mIsDesktopRequest = true;
+    *aLaunchType = GetLaunchType();
+    mIsDesktopRequest = (*aLaunchType == AHE_DESKTOP);
+    SetLastAHE(*aLaunchType);
+    return S_OK;
+  }
+
+  /**
+   * Choose the appropriate launch type based on the user's previously chosen
+   * host environment, along with system constraints.
+   */
+  AHE_TYPE GetLaunchType() {
+    AHE_TYPE ahe = GetLastAHE();
+    Log(L"Previous AHE: %d", ahe);
 
     if (!mIsRestartMetroRequest && IsProcessRunning(kFirefoxExe, false)) {
-      return S_OK;
+      Log(L"Returning AHE_DESKTOP because desktop is already running");
+      return AHE_DESKTOP;
     } else if (!mIsRestartDesktopRequest && IsProcessRunning(kMetroFirefoxExe, true)) {
-      *aLaunchType = AHE_IMMERSIVE;
-      mIsDesktopRequest = false;
-      return S_OK;
-    }
-
-    if (!mUnkSite) {
-      Log(L"No mUnkSite.");
-      return S_OK;
+      Log(L"Returning AHE_IMMERSIVE because Metro is already running");
+      return AHE_IMMERSIVE;
     }
 
     if (mIsRestartDesktopRequest) {
       Log(L"Restarting in desktop host environment.");
-      return S_OK;
+      return AHE_DESKTOP;
     }
 
-    HRESULT hr;
-    IServiceProvider* pSvcProvider = nullptr;
-    hr = mUnkSite->QueryInterface(IID_IServiceProvider, (void**)&pSvcProvider);
-    if (!pSvcProvider) {
-      Log(L"Couldn't get IServiceProvider service from explorer. (%X)", hr);
-      return S_OK;
+    if (mIsRestartMetroRequest) {
+      Log(L"Restarting in metro host environment.");
+      ahe = AHE_IMMERSIVE;
     }
 
-    IExecuteCommandHost* pHost = nullptr;
-    // If we can't get this it's a conventional desktop launch
-    hr = pSvcProvider->QueryService(SID_ExecuteCommandHost,
-                                    IID_IExecuteCommandHost, (void**)&pHost);
-    if (!pHost) {
-      Log(L"Couldn't get IExecuteCommandHost service from explorer. (%X)", hr);
-      SafeRelease(&pSvcProvider);
-      return S_OK;
-    }
-    SafeRelease(&pSvcProvider);
-
-    EC_HOST_UI_MODE mode;
-    if (FAILED(pHost->GetUIMode(&mode))) {
-      Log(L"GetUIMode failed.");
-      SafeRelease(&pHost);
-      return S_OK;
-    }
+    if (ahe == AHE_IMMERSIVE) {
+      if (!IsDefaultBrowser()) {
+        Log(L"returning AHE_DESKTOP because we are not the default browser");
+        return AHE_DESKTOP;
+      }
 
-    // 0 - launched from desktop
-    // 1 - ?
-    // 2 - launched from tile interface
-    Log(L"GetUIMode: %d", mode);
-
-    if (!IsDefaultBrowser()) {
-      mode = ECHUIM_DESKTOP;
+      if (!IsDX10Available()) {
+        Log(L"returning AHE_DESKTOP because DX10 is not available");
+        return AHE_DESKTOP;
+      }
     }
-
-    if (mode == ECHUIM_DESKTOP) {
-      Log(L"returning AHE_DESKTOP");
-      SafeRelease(&pHost);
-      return S_OK;
-    }
-    SafeRelease(&pHost);
-
-    if (!IsDX10Available()) {
-      Log(L"returning AHE_DESKTOP because DX10 is not available");
-      *aLaunchType = AHE_DESKTOP;
-      mIsDesktopRequest = true;
-    } else {
-      Log(L"returning AHE_IMMERSIVE");
-      *aLaunchType = AHE_IMMERSIVE;
-      mIsDesktopRequest = false;
-    }
-    return S_OK;
+    return ahe;
   }
 
   /*
    * Retrieve the target path if it is the default browser
    * or if not default, retreives the target path if it is a firefox browser
    * or if the target is not firefox, relies on a hack to get the
    * 'module dir path\firefox.exe'
    * The reason why it's not good to rely on the CEH path is because there is
--- a/browser/themes/shared/devtools/common.css
+++ b/browser/themes/shared/devtools/common.css
@@ -19,26 +19,28 @@
 %ifdef XP_WIN
   font-family: Consolas, monospace;
 %endif
 }
 
 /* Splitters */
 .devtools-horizontal-splitter {
   -moz-appearance: none;
+  background-image: none;
   border-top: 1px solid black;
   border-bottom-width: 0;
   min-height: 3px;
   height: 3px;
   margin-bottom: -3px;
   position: relative;
 }
 
 .devtools-side-splitter {
   -moz-appearance: none;
+  background-image: none;
   border: 0;
   -moz-border-start: 1px solid black;
   min-width: 0;
   width: 3px;
   background-color: transparent;
   -moz-margin-end: -3px;
   position: relative;
   cursor: e-resize;
--- a/embedding/android/geckoview_example/Makefile.in
+++ b/embedding/android/geckoview_example/Makefile.in
@@ -16,19 +16,21 @@ GARBAGE_DIRS = \
 	bin \
 	libs \
 	res \
 	src \
 	$(NULL)
 
 ANDROID=$(ANDROID_SDK)/../../tools/android
 
+TARGET= $(notdir $(ANDROID_SDK))
+
 build.xml:
-	$(ANDROID) create project --name GeckoViewExample --target android-18 --path $(CURDIR) --activity GeckoViewExample --package org.mozilla.geckoviewexample
-	$(ANDROID) update project --target android-18 --path $(CURDIR) --library $(DEPTH)/mobile/android/geckoview_library
+	$(ANDROID) create project --name GeckoViewExample --target $(TARGET) --path $(CURDIR) --activity GeckoViewExample --package org.mozilla.geckoviewexample
+	$(ANDROID) update project --target $(TARGET) --path $(CURDIR) --library $(DEPTH)/mobile/android/geckoview_library
 	$(UNZIP) -o $(DIST)/geckoview_library/geckoview_assets.zip
 	$(NSINSTALL) $(srcdir)/main.xml res/layout/
 	$(NSINSTALL) $(srcdir)/AndroidManifest.xml .
 	$(NSINSTALL) $(srcdir)/GeckoViewExample.java src/org/mozilla/geckoviewexample/
 	echo jar.libs.dir=libs >> project.properties
 
 package: build.xml
 	ant debug