merge fx-team to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 07 Oct 2014 14:37:32 +0200
changeset 232312 22d0cde0ddfc7df08b56f0a3647d8972435b5a20
parent 232306 f65726bd726555bd7cab954c3347931f4c9d4c00 (current diff)
parent 232311 896e255af48ebaf6fc0b5581865fcdbd53e07733 (diff)
child 232322 25a98bac926420e5fcca88d79b400c1b1c10faa5
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone35.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 mozilla-central a=merge
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -672,17 +672,19 @@ let MozLoopServiceInternal = {
     // bug 1046039 for background.
     Services.prefs.setCharPref("loop.seenToS", "seen");
 
     // Request the information on the new call(s) associated with this version.
     // The registered FxA session is checked first, then the anonymous session.
     // Make the call to get the GUEST session regardless of whether the FXA
     // request fails.
 
-    this._getCalls(LOOP_SESSION_TYPE.FXA, version).catch(() => {});
+    if (MozLoopService.userProfile) {
+      this._getCalls(LOOP_SESSION_TYPE.FXA, version).catch(() => {});
+    }
     this._getCalls(LOOP_SESSION_TYPE.GUEST, version).catch(
       error => {this._hawkRequestError(error);});
   },
 
   /**
    * Make a hawkRequest to GET/calls?=version for this session type.
    *
    * @param {LOOP_SESSION_TYPE} sessionType - type of hawk token used
--- a/browser/components/loop/test/xpcshell/test_loopservice_busy.js
+++ b/browser/components/loop/test/xpcshell/test_loopservice_busy.js
@@ -47,16 +47,20 @@ function test_send_busy_on_call() {
 
 add_test(test_send_busy_on_call); //FXA call accepted, Guest call rejected
 add_test(test_send_busy_on_call); //No FXA call, first Guest call accepted, second rejected
 
 function run_test()
 {
   setupFakeLoopServer();
 
+  // Setup fake login (profile) state so we get FxA requests.
+  const serviceGlobal = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
+  serviceGlobal.gFxAOAuthProfile = {email: "test@example.com", uid: "abcd1234"};
+
   // For each notification received from the PushServer, MozLoopService will first query
   // for any pending calls on the FxA hawk session and then again using the guest session.
   // A pair of response objects in the callsResponses array will be consumed for each
   // notification. The even calls object is for the FxA session, the odd the Guest session.
 
   let callsRespCount = 0;
   let callsResponses = [
     {calls: [{callId: firstCallId,
@@ -92,14 +96,17 @@ function run_test()
     response.processAsync();
     response.finish();
   });
 
   do_register_cleanup(function() {
     // Revert original Chat.open implementation
     Chat.open = openChatOrig;
 
+    // Revert fake login state
+    serviceGlobal.gFxAOAuthProfile = null;
+
     // clear test pref
     Services.prefs.clearUserPref("loop.seenToS");
   });
 
   run_next_test();
 }
--- a/browser/config/mozconfigs/linux32/common-opt
+++ b/browser/config/mozconfigs/linux32/common-opt
@@ -1,13 +1,14 @@
 # This file is sourced by nightly, beta, and release mozconfigs.
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --with-google-api-keyfile=/builds/gapi.data
+ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 . $topsrcdir/build/unix/mozconfig.linux32
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/browser/config/mozconfigs/linux64/common-opt
+++ b/browser/config/mozconfigs/linux64/common-opt
@@ -1,13 +1,14 @@
 # This file is sourced by the nightly, beta, and release mozconfigs.
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --with-google-api-keyfile=/builds/gapi.data
+ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 . $topsrcdir/build/unix/mozconfig.linux
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/browser/config/mozconfigs/macosx-universal/common-opt
+++ b/browser/config/mozconfigs/macosx-universal/common-opt
@@ -3,16 +3,17 @@
 . $topsrcdir/build/macosx/universal/mozconfig
 
 # Universal builds override the default of browser (bug 575283 comment 29)
 ac_add_options --enable-application=browser
 
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --with-google-api-keyfile=/builds/gapi.data
+ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
--- a/browser/config/mozconfigs/win32/common-opt
+++ b/browser/config/mozconfigs/win32/common-opt
@@ -9,16 +9,22 @@ ac_add_options --enable-require-all-d3dc
 
 if [ -f /c/builds/gapi.data ]; then
   _gapi_keyfile=/c/builds/gapi.data
 else
   _gapi_keyfile=/e/builds/gapi.data
 fi
 ac_add_options --with-google-api-keyfile=${_gapi_keyfile}
 
+if [ -f /c/builds/google-oauth-api.key ]; then
+  _google_oauth_api_keyfile=/c/builds/google-oauth-api.key
+else
+  _google_oauth_api_keyfile=/e/builds/google-oauth-api.key
+fi
+ac_add_options --with-google-api-keyfile=${_google_oauth_api_keyfile}
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
   . $topsrcdir/build/win32/mozconfig.vs2010-win64
--- a/browser/config/mozconfigs/win64/common-opt
+++ b/browser/config/mozconfigs/win64/common-opt
@@ -7,15 +7,22 @@ ac_add_options --enable-update-packaging
 ac_add_options --enable-jemalloc
 if [ -f /c/builds/gapi.data ]; then
   _gapi_keyfile=/c/builds/gapi.data
 else
   _gapi_keyfile=/e/builds/gapi.data
 fi
 ac_add_options --with-google-api-keyfile=${_gapi_keyfile}
 
+if [ -f /c/builds/google-oauth-api.key ]; then
+  _google_oauth_api_keyfile=/c/builds/google-oauth-api.key
+else
+  _google_oauth_api_keyfile=/e/builds/google-oauth-api.key
+fi
+ac_add_options --with-google-api-keyfile=${_google_oauth_api_keyfile}
+
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
--- a/browser/modules/UITour.jsm
+++ b/browser/modules/UITour.jsm
@@ -93,17 +93,20 @@ this.UITour = {
                                                         "class",
                                                         "toolbarbutton-icon");
       },
       widgetName: "PanelUI-customize",
     }],
     ["help",        {query: "#PanelUI-help"}],
     ["home",        {query: "#home-button"}],
     ["loop",        {query: "#loop-call-button"}],
-    ["forget",      {query: "#panic-button"}],
+    ["forget", {
+      query: "#panic-button",
+      widgetName: "panic-button",
+      allowAdd: true }],
     ["privateWindow",  {query: "#privatebrowsing-button"}],
     ["quit",        {query: "#PanelUI-quit"}],
     ["search",      {
       query: "#searchbar",
       widgetName: "search-container",
     }],
     ["searchProvider", {
       query: (aDocument) => {
@@ -429,16 +432,25 @@ this.UITour = {
         break;
       }
 
       case "resetFirefox": {
         // Open a reset profile dialog window.
         ResetProfile.openConfirmationDialog(window);
         break;
       }
+
+      case "addNavBarWidget": {
+        // Add a widget to the toolbar
+        let targetPromise = this.getTarget(window, data.name);
+        targetPromise.then(target => {
+          this.addNavBarWidget(target, contentDocument, data.callbackID);
+        }).then(null, Cu.reportError);
+        break;
+      }
     }
 
     if (!this.originTabs.has(window))
       this.originTabs.set(window, new Set());
 
     this.originTabs.get(window).add(tab);
     tab.addEventListener("TabClose", this);
     tab.addEventListener("TabBecomingWindow", this);
@@ -693,16 +705,17 @@ this.UITour = {
       }
 
       deferred.resolve({
         addTargetListener: targetObject.addTargetListener,
         node: node,
         removeTargetListener: targetObject.removeTargetListener,
         targetName: aTargetName,
         widgetName: targetObject.widgetName,
+        allowAdd: targetObject.allowAdd,
       });
     }).then(null, Cu.reportError);
     return deferred.promise;
   },
 
   targetIsInAppMenu: function(aTarget) {
     let placement = CustomizableUI.getPlacementOfWidget(aTarget.widgetName || aTarget.node.id);
     if (placement && placement.area == CustomizableUI.AREA_PANEL) {
@@ -1172,16 +1185,34 @@ this.UITour = {
     }, (err) => {
       Cu.reportError(err);
       this.sendPageCallback(aContentDocument, aCallbackID, {
         targets: [],
       });
     });
   },
 
+  addNavBarWidget: function (aTarget, aContentDocument, aCallbackID) {
+    if (aTarget.node) {
+      Cu.reportError("UITour: can't add a widget already present: " + data.target);
+      return;
+    }
+    if (!aTarget.allowAdd) {
+      Cu.reportError("UITour: not allowed to add this widget: " + data.target);
+      return;
+    }
+    if (!aTarget.widgetName) {
+      Cu.reportError("UITour: can't add a widget without a widgetName property: " + data.target);
+      return;
+    }
+
+    CustomizableUI.addWidgetToArea(aTarget.widgetName, CustomizableUI.AREA_NAVBAR);
+    this.sendPageCallback(aContentDocument, aCallbackID);
+  },
+
   _addAnnotationPanelMutationObserver: function(aPanelEl) {
 #ifdef XP_LINUX
     let observer = this._annotationPanelMutationObservers.get(aPanelEl);
     if (observer) {
       return;
     }
     let win = aPanelEl.ownerDocument.defaultView;
     observer = new win.MutationObserver(this._annotationMutationCallback);
--- a/browser/modules/test/browser_UITour.js
+++ b/browser/modules/test/browser_UITour.js
@@ -272,15 +272,40 @@ let tests = [
         ok(typeof(result[property]) !== undefined, "Check " + property + " isn't undefined.");
         is(result[property], Services.appinfo[property], "Should have the same " + property + " property.");
       }
       done();
     }
 
     gContentAPI.getConfiguration("appinfo", callback);
   },
+  function test_addToolbarButton(done) {
+    let placement = CustomizableUI.getPlacementOfWidget("panic-button");
+    is(placement, null, "default UI has panic button in the palette");
+
+    gContentAPI.getConfiguration("availableTargets", (data) => {
+      let available = (data.targets.indexOf("forget") != -1);
+      ok(!available, "Forget button should not be available by default");
+
+      gContentAPI.addNavBarWidget("forget", () => {
+        info("addNavBarWidget callback successfully called");
+
+        let placement = CustomizableUI.getPlacementOfWidget("panic-button");
+        is(placement.area, CustomizableUI.AREA_NAVBAR);
+
+        gContentAPI.getConfiguration("availableTargets", (data) => {
+          let available = (data.targets.indexOf("forget") != -1);
+          ok(available, "Forget button should now be available");
+
+          // Cleanup
+          CustomizableUI.removeWidgetFromArea("panic-button");
+          done();
+        });
+      });
+    });
+  },
 
   // Make sure this test is last in the file so the appMenu gets left open and done will confirm it got tore down.
   function cleanupMenus(done) {
     gContentAPI.showMenu("appMenu");
     done();
   },
 ];
--- a/browser/modules/test/uitour.js
+++ b/browser/modules/test/uitour.js
@@ -178,9 +178,16 @@ if (typeof Mozilla == 'undefined') {
 	Mozilla.UITour.showFirefoxAccounts = function() {
 		_sendEvent('showFirefoxAccounts');
 	};
 
 	Mozilla.UITour.resetFirefox = function() {
 		_sendEvent('resetFirefox');
 	};
 
+	Mozilla.UITour.addNavBarWidget= function(name, callback) {
+		_sendEvent('addNavBarWidget', {
+			name: name,
+			callbackID: _waitForCallback(callback),
+		});
+	};
+
 })();
--- a/mobile/android/base/newtablet/res/drawable-large-v11/new_tablet_action_bar_button.xml
+++ b/mobile/android/base/newtablet/res/drawable-large-v11/new_tablet_action_bar_button.xml
@@ -8,32 +8,32 @@
     <item android:state_pressed="true"
           android:state_enabled="true">
 
         <inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
                android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
                android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
                android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
             <shape android:shape="rectangle">
-                <solid android:color="#D7D7DC"/>
+                <solid android:color="@color/new_tablet_highlight"/>
                 <corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
             </shape>
         </inset>
 
     </item>
 
     <item android:state_focused="true"
           android:state_pressed="false">
 
         <inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
                android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
                android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
                android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
             <shape android:shape="rectangle">
-                <solid android:color="#C0C9D0"/>
+                <solid android:color="@color/new_tablet_highlight_focused"/>
                 <corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
             </shape>
         </inset>
 
     </item>
 
     <item>
         <shape android:shape="rectangle">
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/newtablet/res/drawable-large-v11/new_tablet_url_bar_nav_button.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+          xmlns:gecko="http://schemas.android.com/apk/res-auto">
+
+    <!-- private pressed state -->
+    <item gecko:state_private="true"
+          android:state_pressed="true"
+          android:drawable="@color/new_tablet_highlight_pb"/>
+
+    <!-- focused state -->
+    <item gecko:state_private="true"
+          android:state_focused="true"
+          android:state_pressed="false"
+          android:drawable="@color/new_tablet_highlight_focused_pb"/>
+
+    <!-- pressed state -->
+    <item android:state_pressed="true"
+          android:drawable="@color/new_tablet_highlight"/>
+
+    <!-- focused state -->
+    <item android:state_focused="true"
+          android:state_pressed="false"
+          android:drawable="@color/new_tablet_highlight_focused"/>
+
+    <!-- private browsing mode -->
+    <item gecko:state_private="true"
+          android:drawable="@color/background_private"/>
+
+    <!-- normal mode -->
+    <item android:drawable="@color/background_normal"/>
+
+</selector>
--- a/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_browser_toolbar.xml
+++ b/mobile/android/base/newtablet/res/layout-large-v11/new_tablet_browser_toolbar.xml
@@ -27,17 +27,17 @@
                                           style="@style/UrlBar.ImageButton.NewTablet"
                                           android:layout_width="@dimen/back_button_width"
                                           android:layout_height="@dimen/back_button_width"
                                           android:layout_centerVertical="true"
                                           android:layout_marginLeft="12dp"
                                           android:layout_alignParentLeft="true"
                                           android:src="@drawable/new_tablet_ic_menu_back"
                                           android:contentDescription="@string/back"
-                                          android:background="@drawable/url_bar_nav_button"/>
+                                          android:background="@drawable/new_tablet_url_bar_nav_button"/>
 
     <org.mozilla.gecko.toolbar.ToolbarEditLayout android:id="@+id/edit_layout"
                   style="@style/UrlBar.Button"
                   android:paddingLeft="12dp"
                   android:paddingRight="12dp"
                   android:visibility="gone"
                   android:orientation="horizontal"
                   android:layout_toRightOf="@id/back"
--- a/mobile/android/base/resources/values-large-v11/styles.xml
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -28,16 +28,17 @@
     <style name="UrlBar.ImageButton.Forward.NewTablet">
         <item name="android:layout_marginLeft">@dimen/new_tablet_forward_default_offset</item>
         <item name="android:layout_height">match_parent</item>
         <item name="android:paddingTop">0dp</item>
         <item name="android:paddingBottom">0dp</item>
         <item name="android:layout_marginTop">11.5dp</item>
         <item name="android:layout_marginBottom">11.5dp</item>
         <item name="android:src">@drawable/new_tablet_ic_menu_forward</item>
+        <item name="android:background">@drawable/new_tablet_url_bar_nav_button</item>
     </style>
 
     <style name="UrlBar.ImageButton.TabCount.NewTablet">
         <item name="android:background">@drawable/new_tablet_tabs_count</item>
 
         <!-- From UrlBar.ImageButton.NewTablet because we can't inherit directly. -->
         <item name="android:layout_width">@dimen/new_tablet_browser_toolbar_menu_item_width</item>
     </style>
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -8,16 +8,22 @@
   <color name="background_normal">#FFEBEBF0</color>
   <color name="background_private">#FF292C29</color>
   <color name="background_tabs">#FF363B40</color>
   <color name="highlight">#33000000</color>
   <color name="highlight_focused">#1A000000</color>
   <color name="highlight_dark">#33FFFFFF</color>
   <color name="highlight_dark_focused">#1AFFFFFF</color>
 
+  <!-- (bug 1077195) Focused state values are temporary. -->
+  <color name="new_tablet_highlight">#D7D7DC</color>
+  <color name="new_tablet_highlight_focused">#C0C9D0</color>
+  <color name="new_tablet_highlight_pb">#222222</color>
+  <color name="new_tablet_highlight_focused_pb">#363B40</color>
+
   <!-- highlight on shaped button: 20% white over background_tabs -->
   <color name="highlight_shaped">#FF696D71</color>
 
   <!-- highlight-focused on shaped button: 10% white over background_tabs -->
   <color name="highlight_shaped_focused">#FF565B60</color>
 
   <!-- highlight on nav button: 20% black over background_normal -->
   <color name="highlight_nav">#FFA5ACB2</color>