commit 61a4d57b1cc573b85baef431b277149cbf740c74 Author: Arthur Edelstein arthuredelstein@gmail.com Date: Tue May 17 16:40:33 2016 -0700
Bug 18884: Add --disable-loop flag
When a mozconfig file contains ac_add_options --disable-loop
then the Loop extension will not be built or bundled with the browser. --- browser/base/content/browser-menubar.inc | 2 ++ browser/base/content/browser.css | 4 ++++ browser/base/content/browser.xul | 2 ++ browser/components/about/AboutRedirector.cpp | 2 ++ browser/components/customizableui/content/panelUI.inc.xul | 2 ++ browser/extensions/moz.build | 4 +++- browser/installer/package-manifest.in | 2 ++ browser/locales/Makefile.in | 4 +++- browser/locales/jar.mn | 2 ++ configure.in | 14 ++++++++++++++ 10 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index a987975..2c01c13 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -500,10 +500,12 @@ key="key_openAddons" command="Tools:Addons"/>
+#ifdef MOZ_LOOP <menuitem id="menu_openLoop" label="&loopMenuItem.label;" accesskey = "&loopMenuItem.accesskey;" oncommand="LoopUI.togglePanel();"/> +#endif
<!-- only one of sync-setup, sync-syncnowitem or sync-reauthitem will be showing at once --> <menuitem id="sync-setup" diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index c5dd9b4..f93d13f 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -18,6 +18,7 @@ %endif }
+%ifdef MOZ_LOOP /* These values are chosen to keep the Loop detached chat window from * getting too small. When it's too small, three bad things happen: * @@ -41,6 +42,7 @@ min-width: 260px; min-height: 315px; } +%endif
#main-window[customize-entered] { min-width: -moz-fit-content; @@ -914,6 +916,7 @@ chatbox[customSize] { min-width: 350px; }
+%ifdef MOZ_LOOP chatbox[customSize="loopChatEnabled"] { /* 430px as defined per UX */ height: 430px; @@ -938,6 +941,7 @@ chatbox[customSize="loopChatDisabledMessageAppended"] { /* 445px + 30px top bar height. */ min-height: calc(400px + 30px); } +%endif
chatbox[minimized="true"] { width: 160px; diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index c63dfed..8749477 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -290,6 +290,7 @@ noautofocus="true" position="topcenter topright"/>
+#ifdef MOZ_LOOP <panel id="loop-notification-panel" class="loop-panel social-panel" type="arrow" @@ -301,6 +302,7 @@ type="arrow" orient="horizontal" hidden="true"/> +#endif
<menupopup id="toolbar-context-menu" onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator'));"> diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp index ab069e5..2f956b2 100644 --- a/browser/components/about/AboutRedirector.cpp +++ b/browser/components/about/AboutRedirector.cpp @@ -108,6 +108,7 @@ static RedirEntry kRedirMap[] = { { "debugging", "chrome://devtools/content/aboutdebugging/aboutdebugging.xhtml", nsIAboutModule::ALLOW_SCRIPT }, +#ifdef MOZ_LOOP { "loopconversation", "chrome://loop/content/panels/conversation.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | @@ -120,6 +121,7 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::ENABLE_INDEXED_DB, // Shares an IndexedDB origin with about:loopconversation. "loopconversation" }, +#endif { "reader", "chrome://global/content/reader/aboutReader.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | diff --git a/browser/components/customizableui/content/panelUI.inc.xul b/browser/components/customizableui/content/panelUI.inc.xul index 99bca07..f8975bf 100644 --- a/browser/components/customizableui/content/panelUI.inc.xul +++ b/browser/components/customizableui/content/panelUI.inc.xul @@ -243,7 +243,9 @@
<panelview id="PanelUI-socialapi" flex="1"/>
+#ifdef MOZ_LOOP <panelview id="PanelUI-loopapi" flex="1"/> +#endif
<panelview id="PanelUI-feeds" flex="1" oncommand="FeedHandler.subscribeToFeed(null, event);"> <label value="&feedsMenu.label;" class="panel-subview-header"/> diff --git a/browser/extensions/moz.build b/browser/extensions/moz.build index b4d84e4..ef6a439 100644 --- a/browser/extensions/moz.build +++ b/browser/extensions/moz.build @@ -5,6 +5,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += [ - 'loop', 'pdfjs', ] + +if CONFIG['MOZ_LOOP']: + DIRS += ['loop'] diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index c3ce1a5..3d2c507 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -669,7 +669,9 @@ @RESPATH@/browser/chrome/icons/default/default32.png @RESPATH@/browser/chrome/icons/default/default48.png #endif +#ifdef MOZ_LOOP @RESPATH@/browser/features/* +#endif #MOZ_LOOP
; [Webide Files] @RESPATH@/browser/chrome/webide@JAREXT@ diff --git a/browser/locales/Makefile.in b/browser/locales/Makefile.in index be9454e..ae13de4 100644 --- a/browser/locales/Makefile.in +++ b/browser/locales/Makefile.in @@ -133,7 +133,9 @@ ifdef MOZ_WEBAPP_RUNTIME @$(MAKE) -C ../../webapprt/locales AB_CD=$* XPI_NAME=locale-$* endif @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* - @$(MAKE) -C ../extensions/loop/chrome/locale AB_CD=$* XPI_NAME=locale-$* +ifdef MOZ_LOOP + @$(MAKE) -C ../extensions/loop/chrome/locale AB_CD=$* XPI_NAME=locale-$* +endif @$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)' @$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$* diff --git a/browser/locales/jar.mn b/browser/locales/jar.mn index 0f18e06..63c19d4 100644 --- a/browser/locales/jar.mn +++ b/browser/locales/jar.mn @@ -30,7 +30,9 @@ locale/browser/browser-pocket.properties (%chrome/browser/browser-pocket.properties) locale/browser/customizableui/customizableWidgets.properties (%chrome/browser/customizableui/customizableWidgets.properties) locale/browser/lightweightThemes.properties (%chrome/browser/lightweightThemes.properties) +#ifdef MOZ_LOOP locale/browser/loop/loop.properties (%chrome/browser/loop/loop.properties) +#endif locale/browser/newTab.dtd (%chrome/browser/newTab.dtd) locale/browser/newTab.properties (%chrome/browser/newTab.properties) locale/browser/pageInfo.dtd (%chrome/browser/pageInfo.dtd) diff --git a/configure.in b/configure.in index 885ee84..2b0c949 100644 --- a/configure.in +++ b/configure.in @@ -3737,6 +3737,7 @@ MOZ_URL_CLASSIFIER= MOZ_XUL=1 MOZ_ZIPWRITER=1 NS_PRINTING=1 +MOZ_LOOP=1 if test "$MOZ_IOS"; then NS_PRINTING= fi @@ -8456,6 +8457,19 @@ if test "$NECKO_COOKIES"; then _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES" fi
+dnl ======================================================== +dnl disable loop extension +dnl ======================================================== +MOZ_ARG_DISABLE_BOOL(loop, +[ --disable-loop + Disable loop extension], + MOZ_LOOP=, + MOZ_LOOP=1 ) +if test "$MOZ_LOOP"; then + AC_DEFINE(MOZ_LOOP) +fi +AC_SUBST(MOZ_LOOP) + dnl dnl Always build Marionette if not Android or B2G dnl
tbb-commits@lists.torproject.org