diff options
author | Moonchild <moonchild@palemoon.org> | 2021-05-06 09:24:03 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-05-06 09:24:03 +0000 |
commit | 6f707bde95dab6998ac204f9ee6c925ee230c740 (patch) | |
tree | 859f6cf99f2e026b76dcc40b27b211154310d16e /toolkit/components | |
parent | aa0fd3d68c856504646e1d7eb499bc890ef44101 (diff) | |
download | uxp-6f707bde95dab6998ac204f9ee6c925ee230c740.tar.gz |
Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer
needed without XP_MACOSX conditionals.
Diffstat (limited to 'toolkit/components')
26 files changed, 28 insertions, 332 deletions
diff --git a/toolkit/components/apppicker/content/appPicker.js b/toolkit/components/apppicker/content/appPicker.js index 21a007632b..6922fce39f 100644 --- a/toolkit/components/apppicker/content/appPicker.js +++ b/toolkit/components/apppicker/content/appPicker.js @@ -119,12 +119,6 @@ AppPicker.prototype = return file.getVersionInfoField("FileDescription"); } catch (e) {} } -#elifdef XP_MACOSX - if (file instanceof Components.interfaces.nsILocalFileMac) { - try { - return file.bundleDisplayName; - } catch (e) {} - } #endif return file.leafName; }, @@ -183,8 +177,6 @@ AppPicker.prototype = var startLocation; #ifdef XP_WIN startLocation = "ProgF"; // Program Files -#elifdef XP_MACOSX - startLocation = "LocApp"; // Local Applications #else startLocation = "Home"; #endif diff --git a/toolkit/components/blocklist/nsBlocklistService.js b/toolkit/components/blocklist/nsBlocklistService.js index 67f283b26a..e402d76601 100644 --- a/toolkit/components/blocklist/nsBlocklistService.js +++ b/toolkit/components/blocklist/nsBlocklistService.js @@ -114,15 +114,6 @@ XPCOMUtils.defineLazyGetter(this, "gABI", function() { LOG("BlockList Global gABI: XPCOM ABI unknown."); } -#ifdef XP_MACOSX - // Mac universal build should report a different ABI than either macppc - // or mactel. - let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"]. - getService(Ci.nsIMacUtils); - - if (macutils.isUniversalBinary) - abi += "-u-" + macutils.architecturesInBinary; -#endif return abi; }); diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index 587c1ac8ab..bc01b9ae58 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -57,10 +57,6 @@ #endif #endif -#ifdef XP_MACOSX -#include <CoreFoundation/CoreFoundation.h> -#endif - #ifdef MOZ_WIDGET_GTK #include <gtk/gtk.h> #endif @@ -1376,12 +1372,7 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult) mBundle->GetStringFromName(u"downloadsFolder", getter_Copies(folderName)); -#if defined (XP_MACOSX) - rv = dirService->Get(NS_OSX_DEFAULT_DOWNLOAD_DIR, - NS_GET_IID(nsIFile), - getter_AddRefs(downloadDir)); - NS_ENSURE_SUCCESS(rv, rv); -#elif defined(XP_WIN) +#if defined(XP_WIN) rv = dirService->Get(NS_WIN_DEFAULT_DOWNLOAD_DIR, NS_GET_IID(nsIFile), getter_AddRefs(downloadDir)); @@ -2445,19 +2436,11 @@ nsDownloadManager::Observe(nsISupports *aSubject, nsCOMPtr<nsISupportsPRBool> cancelDownloads = do_QueryInterface(aSubject, &rv); NS_ENSURE_SUCCESS(rv, rv); -#ifndef XP_MACOSX ConfirmCancelDownloads(currDownloadCount, cancelDownloads, u"quitCancelDownloadsAlertTitle", u"quitCancelDownloadsAlertMsgMultiple", u"quitCancelDownloadsAlertMsg", u"dontQuitButtonWin"); -#else - ConfirmCancelDownloads(currDownloadCount, cancelDownloads, - u"quitCancelDownloadsAlertTitle", - u"quitCancelDownloadsAlertMsgMacMultiple", - u"quitCancelDownloadsAlertMsgMac", - u"dontQuitButtonMac"); -#endif } else if (strcmp(aTopic, "offline-requested") == 0 && currDownloadCount) { nsCOMPtr<nsISupportsPRBool> cancelDownloads = do_QueryInterface(aSubject, &rv); @@ -2747,7 +2730,7 @@ nsDownload::SetState(DownloadState aState) } } -#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget); nsCOMPtr<nsIFile> file; nsAutoString path; @@ -2757,7 +2740,6 @@ nsDownload::SetState(DownloadState aState) file && NS_SUCCEEDED(file->GetPath(path))) { -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) // On Windows and Gtk, add the download to the system's "recent documents" // list, with a pref to disable. { @@ -2795,18 +2777,6 @@ nsDownload::SetState(DownloadState aState) g_object_unref(gio_file); #endif } -#endif - -#ifdef XP_MACOSX - // On OS X, make the downloads stack bounce. - CFStringRef observedObject = ::CFStringCreateWithCString(kCFAllocatorDefault, - NS_ConvertUTF16toUTF8(path).get(), - kCFStringEncodingUTF8); - CFNotificationCenterRef center = ::CFNotificationCenterGetDistributedCenter(); - ::CFNotificationCenterPostNotification(center, CFSTR("com.apple.DownloadFileFinished"), - observedObject, nullptr, TRUE); - ::CFRelease(observedObject); -#endif } #ifdef XP_WIN @@ -3389,14 +3359,10 @@ nsDownload::OpenWithApplication() if (!prefs || NS_FAILED(prefs->GetBoolPref(PREF_BH_DELETETEMPFILEONEXIT, &deleteTempFileOnExit))) { // No prefservice or no pref set; use default value -#if !defined(XP_MACOSX) - // Mac users have been very verbal about temp files being deleted on + // Some users have been very verbal about temp files being deleted on // app exit - they don't like it - but we'll continue to do this on - // other platforms for now. + // all platforms for now. deleteTempFileOnExit = true; -#else - deleteTempFileOnExit = false; -#endif } // Always schedule files to be deleted at the end of the private browsing diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index d47ebcd638..039978c52e 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -312,9 +312,7 @@ this.DownloadIntegration = { } let directoryPath = null; -#ifdef XP_MACOSX - directoryPath = this._getDirectory("DfltDwnld"); -#elifdef XP_WIN +#ifdef XP_WIN // For XP/2K, use My Documents/Downloads. Other version uses // the default Downloads directory. let version = parseFloat(Services.sysinfo.getProperty("version")); @@ -383,11 +381,7 @@ this.DownloadIntegration = { */ getTemporaryDownloadsDirectory: Task.async(function* () { let directoryPath = null; -#ifdef XP_MACOSX - directoryPath = yield this.getPreferredDownloadsDirectory(); -#else directoryPath = this._getDirectory("TmpD"); -#endif return directoryPath; }), diff --git a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp index 66ad2b8fa8..14277e5bd4 100644 --- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp +++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp @@ -25,11 +25,6 @@ #include "nsILocalFileWin.h" #endif -#ifdef XP_MACOSX -#include <CoreFoundation/CoreFoundation.h> -#include "../../../../xpcom/io/CocoaFileUtils.h" -#endif - #ifdef MOZ_WIDGET_GTK #include <gtk/gtk.h> #endif @@ -69,39 +64,13 @@ static void gio_set_metadata_done(GObject *source_obj, GAsyncResult *res, gpoint } #endif -#ifdef XP_MACOSX -// Caller is responsible for freeing any result (CF Create Rule) -CFURLRef CreateCFURLFromNSIURI(nsIURI *aURI) { - nsAutoCString spec; - if (aURI) { - aURI->GetSpec(spec); - } - - CFStringRef urlStr = ::CFStringCreateWithCString(kCFAllocatorDefault, - spec.get(), - kCFStringEncodingUTF8); - if (!urlStr) { - return NULL; - } - - CFURLRef url = ::CFURLCreateWithString(kCFAllocatorDefault, - urlStr, - NULL); - - ::CFRelease(urlStr); - - return url; -} -#endif - nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIFile* aTarget, const nsACString& aContentType, bool aIsPrivate) { -#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) nsAutoString path; if (aTarget && NS_SUCCEEDED(aTarget->GetPath(path))) { -#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) // On Windows and Gtk, add the download to the system's "recent documents" // list, with a pref to disable. { @@ -136,53 +105,10 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIF nullptr, gio_set_metadata_done, nullptr); g_object_unref(file_info); g_object_unref(gio_file); -#endif +#endif // MOZ_ENABLE_GIO } -#endif - -#ifdef XP_MACOSX - // On OS X, make the downloads stack bounce. - CFStringRef observedObject = ::CFStringCreateWithCString(kCFAllocatorDefault, - NS_ConvertUTF16toUTF8(path).get(), - kCFStringEncodingUTF8); - CFNotificationCenterRef center = ::CFNotificationCenterGetDistributedCenter(); - ::CFNotificationCenterPostNotification(center, CFSTR("com.apple.DownloadFileFinished"), - observedObject, nullptr, TRUE); - ::CFRelease(observedObject); - - // Add OS X origin and referrer file metadata - CFStringRef pathCFStr = NULL; - if (!path.IsEmpty()) { - pathCFStr = ::CFStringCreateWithCharacters(kCFAllocatorDefault, - (const UniChar*)path.get(), - path.Length()); - } - if (pathCFStr) { - bool isFromWeb = IsURLPossiblyFromWeb(aSource); - - CFURLRef sourceCFURL = CreateCFURLFromNSIURI(aSource); - CFURLRef referrerCFURL = CreateCFURLFromNSIURI(aReferrer); - - CocoaFileUtils::AddOriginMetadataToFile(pathCFStr, - sourceCFURL, - referrerCFURL); - CocoaFileUtils::AddQuarantineMetadataToFile(pathCFStr, - sourceCFURL, - referrerCFURL, - isFromWeb); - - ::CFRelease(pathCFStr); - if (sourceCFURL) { - ::CFRelease(sourceCFURL); - } - if (referrerCFURL) { - ::CFRelease(referrerCFURL); - } - } -#endif } - -#endif +#endif // defined(XP_WIN) || defined(MOZ_WIDGET_GTK) return NS_OK; } diff --git a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm index 3039525f5f..860a325d4b 100644 --- a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm +++ b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm @@ -184,17 +184,10 @@ this.DownloadPrompter.prototype = { switch (aPromptType) { case this.ON_QUIT: title = s.quitCancelDownloadsAlertTitle; -#ifdef XP_MACOSX - message = aDownloadsCount > 1 - ? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount) - : s.quitCancelDownloadsAlertMsgMac; - cancelButton = s.dontQuitButtonMac; -#else message = aDownloadsCount > 1 ? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount) : s.quitCancelDownloadsAlertMsg; cancelButton = s.dontQuitButtonWin; -#endif break; case this.ON_OFFLINE: title = s.offlineCancelDownloadsAlertTitle; diff --git a/toolkit/components/jsdownloads/src/moz.build b/toolkit/components/jsdownloads/src/moz.build index 5a08340ae2..115435f641 100644 --- a/toolkit/components/jsdownloads/src/moz.build +++ b/toolkit/components/jsdownloads/src/moz.build @@ -18,11 +18,11 @@ EXTRA_JS_MODULES += [ 'DownloadList.jsm', 'Downloads.jsm', 'DownloadStore.jsm', + 'DownloadUIHelper.jsm', ] EXTRA_PP_JS_MODULES += [ 'DownloadIntegration.jsm', - 'DownloadUIHelper.jsm', ] FINAL_LIBRARY = 'xul' diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js index 662f212790..de601f4dd8 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.js +++ b/toolkit/components/passwordmgr/content/passwordManager.js @@ -486,12 +486,7 @@ function HandleSignonKeyPress(e) { return; } -#ifdef XP_MACOSX - if (e.keyCode == KeyboardEvent.DOM_VK_DELETE || - e.keyCode == KeyboardEvent.DOM_VK_BACK_SPACE) { -#else if (e.keyCode == KeyboardEvent.DOM_VK_DELETE) { -#endif DeleteSignon(); } } diff --git a/toolkit/components/passwordmgr/content/passwordManager.xul b/toolkit/components/passwordmgr/content/passwordManager.xul index 8590d96aca..b2713ae6c7 100644 --- a/toolkit/components/passwordmgr/content/passwordManager.xul +++ b/toolkit/components/passwordmgr/content/passwordManager.xul @@ -1,4 +1,4 @@ -<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil -*- --> +<?xml version="1.0"?> <!-- -*- Mode: XML; indent-tabs-mode: nil -*- --> # 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/. @@ -126,10 +126,8 @@ <hbox align="end"> <hbox class="actionButtons" flex="1"> <spacer flex="1"/> -#ifndef XP_MACOSX <button oncommand="close();" icon="close" label="&closebutton.label;" accesskey="&closebutton.accesskey;"/> -#endif </hbox> </hbox> </window> diff --git a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp index 59d84ced15..15a021bbab 100644 --- a/toolkit/components/perfmonitoring/nsPerformanceStats.cpp +++ b/toolkit/components/perfmonitoring/nsPerformanceStats.cpp @@ -35,14 +35,7 @@ #include <unistd.h> #endif // defined(XP_WIN) -#if defined(XP_MACOSX) -#include <mach/mach_init.h> -#include <mach/mach_interface.h> -#include <mach/mach_port.h> -#include <mach/mach_types.h> -#include <mach/message.h> -#include <mach/thread_info.h> -#elif defined(XP_UNIX) +#if defined(XP_UNIX) #include <sys/time.h> #include <sys/resource.h> #endif // defined(XP_UNIX) @@ -1239,30 +1232,7 @@ nsPerformanceStatsService::GetResources(uint64_t* userTime, MOZ_ASSERT(userTime); MOZ_ASSERT(systemTime); -#if defined(XP_MACOSX) - // On MacOS X, to get we per-thread data, we need to - // reach into the kernel. - - mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; - thread_basic_info_data_t info; - mach_port_t port = mach_thread_self(); - kern_return_t err = - thread_info(/* [in] targeted thread*/ port, - /* [in] nature of information*/ THREAD_BASIC_INFO, - /* [out] thread information */ (thread_info_t)&info, - /* [inout] number of items */ &count); - - // We do not need ability to communicate with the thread, so - // let's release the port. - mach_port_deallocate(mach_task_self(), port); - - if (err != KERN_SUCCESS) - return NS_ERROR_FAILURE; - - *userTime = info.user_time.microseconds + info.user_time.seconds * 1000000; - *systemTime = info.system_time.microseconds + info.system_time.seconds * 1000000; - -#elif defined(XP_UNIX) +#if defined(XP_UNIX) struct rusage rusage; #if defined(RUSAGE_THREAD) // Under Linux, we can obtain per-thread statistics @@ -1306,7 +1276,7 @@ nsPerformanceStatsService::GetResources(uint64_t* userTime, // Convert 100 ns to 1 us. *userTime = userTimeInt.QuadPart / 10; -#endif // defined(XP_MACOSX) || defined(XP_UNIX) || defined(XP_WIN) +#endif // defined(XP_UNIX) || defined(XP_WIN) return NS_OK; } diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm index 259fb7aa7d..ab753ba86b 100644 --- a/toolkit/components/places/PlacesUtils.jsm +++ b/toolkit/components/places/PlacesUtils.jsm @@ -60,14 +60,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils", // refresh instead. const MIN_TRANSACTIONS_FOR_BATCH = 5; -// On Mac OSX, the transferable system converts "\r\n" to "\n\n", where -// we really just want "\n". On other platforms, the transferable system -// converts "\r\n" to "\n". -#ifdef XP_MACOSX -const NEWLINE = "\n"; -#else +// The transferable system converts "\r\n" to "\n" where needed. const NEWLINE = "\r\n"; -#endif function QI_node(aNode, aIID) { var result = null; diff --git a/toolkit/components/places/moz.build b/toolkit/components/places/moz.build index fda73f761f..4c6ce89565 100644 --- a/toolkit/components/places/moz.build +++ b/toolkit/components/places/moz.build @@ -68,10 +68,9 @@ if CONFIG['MOZ_PLACES']: 'PlacesSearchAutocompleteProvider.jsm', 'PlacesSyncUtils.jsm', 'PlacesTransactions.jsm', + 'PlacesUtils.jsm', ] - EXTRA_PP_JS_MODULES += ['PlacesUtils.jsm'] - EXTRA_COMPONENTS += [ 'ColorAnalyzer.js', 'nsLivemarkService.js', diff --git a/toolkit/components/printing/jar.mn b/toolkit/components/printing/jar.mn index a0e9510304..f77cf1c6aa 100644 --- a/toolkit/components/printing/jar.mn +++ b/toolkit/components/printing/jar.mn @@ -6,11 +6,9 @@ toolkit.jar: content/global/printdialog.js (content/printdialog.js) content/global/printdialog.xul (content/printdialog.xul) #ifdef XP_UNIX -#ifndef XP_MACOSX content/global/printjoboptions.js (content/printjoboptions.js) content/global/printjoboptions.xul (content/printjoboptions.xul) #endif -#endif content/global/printPageSetup.js (content/printPageSetup.js) content/global/printPageSetup.xul (content/printPageSetup.xul) * content/global/printPreviewBindings.xml (content/printPreviewBindings.xml) diff --git a/toolkit/components/prompts/content/commonDialog.xul b/toolkit/components/prompts/content/commonDialog.xul index 990b26586b..a7621ccdfb 100644 --- a/toolkit/components/prompts/content/commonDialog.xul +++ b/toolkit/components/prompts/content/commonDialog.xul @@ -3,7 +3,6 @@ - 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/. --> - <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/content/commonDialog.css" type="text/css"?> <?xml-stylesheet href="chrome://global/skin/commonDialog.css" type="text/css"?> @@ -63,18 +62,9 @@ <hbox id="iconContainer" align="start"> <image id="info.icon" class="spaced"/> </hbox> - <vbox id="infoContainer" -#ifndef XP_MACOSX - pack="center" -#endif - > - <!-- Only shown on OS X, since it has no dialog title --> + <vbox id="infoContainer" pack="center"> <description id="info.title" -#ifndef XP_MACOSX hidden="true" -#else - style="margin-bottom: 1em" -#endif /> <description id="info.body" context="contentAreaContextMenu" noinitialfocus="true"/> </vbox> diff --git a/toolkit/components/prompts/content/tabprompts.xml b/toolkit/components/prompts/content/tabprompts.xml index 0ce13203c1..5355bb4cff 100644 --- a/toolkit/components/prompts/content/tabprompts.xml +++ b/toolkit/components/prompts/content/tabprompts.xml @@ -315,27 +315,16 @@ group="system" action="this.onKeyAction('default', event);"/> <handler event="keypress" keycode="VK_ESCAPE" group="system" action="this.onKeyAction('cancel', event);"/> -#ifdef XP_MACOSX - <handler event="keypress" key="." modifiers="meta" - group="system" action="this.onKeyAction('cancel', event);"/> -#endif <handler event="focus" phase="capturing"> let bnum = this.args.defaultButtonNum || 0; let defaultButton = this.ui["button" + bnum]; -#ifdef XP_MACOSX - // On OS X, the default button always stays marked as such (until - // the entire prompt blurs). - defaultButton.setAttribute("default", true); -#else - // On other platforms, the default button is only marked as such - // when no other button has focus. XUL buttons on not-OSX will - // react to pressing enter as a command, so you can't trigger the - // default without tabbing to it or something that isn't a button. + // The default button is only marked as such when no other button has focus. + // XUL buttons will react to pressing enter as a command, so you can't trigger + // the default without tabbing to it or something that isn't a button. let focusedDefault = (event.originalTarget == defaultButton); let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement; defaultButton.setAttribute("default", focusedDefault || !someButtonFocused); -#endif </handler> <handler event="blur"> // If focus shifted to somewhere else in the browser, don't make diff --git a/toolkit/components/prompts/jar.mn b/toolkit/components/prompts/jar.mn index 60ecbdcbc4..1b5da3f801 100644 --- a/toolkit/components/prompts/jar.mn +++ b/toolkit/components/prompts/jar.mn @@ -4,7 +4,7 @@ toolkit.jar: content/global/commonDialog.js (content/commonDialog.js) -* content/global/commonDialog.xul (content/commonDialog.xul) + content/global/commonDialog.xul (content/commonDialog.xul) content/global/commonDialog.css (content/commonDialog.css) content/global/selectDialog.js (content/selectDialog.js) content/global/selectDialog.xul (content/selectDialog.xul) diff --git a/toolkit/components/satchel/nsFormFillController.cpp b/toolkit/components/satchel/nsFormFillController.cpp index bebc60f521..880ca79b21 100644 --- a/toolkit/components/satchel/nsFormFillController.cpp +++ b/toolkit/components/satchel/nsFormFillController.cpp @@ -1016,27 +1016,11 @@ nsFormFillController::KeyPress(nsIDOMEvent* aEvent) keyEvent->GetKeyCode(&k); switch (k) { case nsIDOMKeyEvent::DOM_VK_DELETE: -#ifndef XP_MACOSX mController->HandleDelete(&cancel); break; case nsIDOMKeyEvent::DOM_VK_BACK_SPACE: mController->HandleText(&unused); break; -#else - case nsIDOMKeyEvent::DOM_VK_BACK_SPACE: - { - bool isShift = false; - keyEvent->GetShiftKey(&isShift); - - if (isShift) { - mController->HandleDelete(&cancel); - } else { - mController->HandleText(&unused); - } - - break; - } -#endif case nsIDOMKeyEvent::DOM_VK_PAGE_UP: case nsIDOMKeyEvent::DOM_VK_PAGE_DOWN: { diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 53f8c56702..ffff6e50ae 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -274,10 +274,6 @@ nsAppStartup::Run(void) // with a zombie process. if (!mShuttingDown && mConsiderQuitStopper != 0) { -#ifdef XP_MACOSX - EnterLastWindowClosingSurvivalArea(); -#endif - mRunning = true; nsresult rv = mAppShell->Run(); @@ -313,45 +309,10 @@ nsAppStartup::Quit(uint32_t aMode) // If we're considering quitting, we will only do so if: if (ferocity == eConsiderQuit) { -#ifdef XP_MACOSX - nsCOMPtr<nsIAppShellService> appShell - (do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); - bool hasHiddenPrivateWindow = false; - if (appShell) { - appShell->GetHasHiddenPrivateWindow(&hasHiddenPrivateWindow); - } - int32_t suspiciousCount = hasHiddenPrivateWindow ? 2 : 1; -#endif - if (mConsiderQuitStopper == 0) { // there are no windows... ferocity = eAttemptQuit; } -#ifdef XP_MACOSX - else if (mConsiderQuitStopper == suspiciousCount) { - // ... or there is only a hiddenWindow left, and it's useless: - - // Failure shouldn't be fatal, but will abort quit attempt: - if (!appShell) - return NS_OK; - - bool usefulHiddenWindow; - appShell->GetApplicationProvidedHiddenWindow(&usefulHiddenWindow); - nsCOMPtr<nsIXULWindow> hiddenWindow; - appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow)); - // If the remaining windows are useful, we won't quit: - nsCOMPtr<nsIXULWindow> hiddenPrivateWindow; - if (hasHiddenPrivateWindow) { - appShell->GetHiddenPrivateWindow(getter_AddRefs(hiddenPrivateWindow)); - if ((!hiddenWindow && !hiddenPrivateWindow) || usefulHiddenWindow) - return NS_OK; - } else if (!hiddenWindow || usefulHiddenWindow) { - return NS_OK; - } - - ferocity = eAttemptQuit; - } -#endif } nsCOMPtr<nsIObserverService> obsService; @@ -406,10 +367,6 @@ nsAppStartup::Quit(uint32_t aMode) if (!mAttemptingQuit) { mAttemptingQuit = true; -#ifdef XP_MACOSX - // now even the Mac wants to quit when the last window is closed - ExitLastWindowClosingSurvivalArea(); -#endif if (obsService) obsService->NotifyObservers(nullptr, "quit-application-granted", nullptr); } diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index a1e01f048a..deae9e8de8 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -8542,14 +8542,6 @@ "kind": "flag", "description": "If a master-password is enabled for this profile" }, - "DISPLAY_SCALING_OSX" : { - "expires_in_version": "never", - "kind": "linear", - "high": 500, - "n_buckets": 100, - "description": "Scaling percentage for the display where the first window is opened (OS X only)", - "cpp_guard": "XP_MACOSX" - }, "DISPLAY_SCALING_MSWIN" : { "expires_in_version": "never", "kind": "linear", diff --git a/toolkit/components/telemetry/histogram-whitelists.json b/toolkit/components/telemetry/histogram-whitelists.json index c81cc7e5df..0aa9061d74 100644 --- a/toolkit/components/telemetry/histogram-whitelists.json +++ b/toolkit/components/telemetry/histogram-whitelists.json @@ -207,7 +207,6 @@ "DEVTOOLS_WEBIDE_WIFI_CONNECTION_RESULT", "DISPLAY_SCALING_LINUX", "DISPLAY_SCALING_MSWIN", - "DISPLAY_SCALING_OSX", "DNS_BLACKLIST_COUNT", "DNS_CLEANUP_AGE", "DNS_FAILED_LOOKUP_TIME", @@ -938,7 +937,6 @@ "DEVTOOLS_WEBIDE_WIFI_CONNECTION_RESULT", "DISPLAY_SCALING_LINUX", "DISPLAY_SCALING_MSWIN", - "DISPLAY_SCALING_OSX", "DNS_BLACKLIST_COUNT", "DNS_CLEANUP_AGE", "DNS_FAILED_LOOKUP_TIME", diff --git a/toolkit/components/thumbnails/PageThumbUtils.jsm b/toolkit/components/thumbnails/PageThumbUtils.jsm index fb5d67ddb5..f91b364800 100644 --- a/toolkit/components/thumbnails/PageThumbUtils.jsm +++ b/toolkit/components/thumbnails/PageThumbUtils.jsm @@ -71,18 +71,6 @@ this.PageThumbUtils = { let windowScale = aWindow ? aWindow.devicePixelRatio : systemScale; let scale = Math.max(systemScale, windowScale); -#ifdef XP_MACOSX - /** * - * On retina displays, we can sometimes go down this path - * without a window object. In those cases, force 2x scaling - * as the system scale doesn't represent the 2x scaling - * on OS X. - */ - if (!aWindow) { - scale = 2; - } -#endif - /** * * THESE VALUES ARE DEFINED IN newtab.css and hard coded. * If you change these values from the prefs, diff --git a/toolkit/components/thumbnails/moz.build b/toolkit/components/thumbnails/moz.build index 92ff2af946..957bc7df0d 100644 --- a/toolkit/components/thumbnails/moz.build +++ b/toolkit/components/thumbnails/moz.build @@ -11,11 +11,11 @@ EXTRA_COMPONENTS += [ EXTRA_JS_MODULES += [ 'PageThumbs.jsm', 'PageThumbsWorker.js', + 'PageThumbUtils.jsm', ] EXTRA_PP_JS_MODULES += [ 'BackgroundPageThumbs.jsm', - 'PageThumbUtils.jsm', ] JAR_MANIFESTS += ['jar.mn'] diff --git a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp index c4ee5f26d1..9fcb4d46d5 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp @@ -83,9 +83,7 @@ namespace safebrowsing { static PlatformType GetPlatformType() { -#if defined(XP_MACOSX) - return OSX_PLATFORM; -#elif defined(XP_LINUX) +#if defined(XP_LINUX) return LINUX_PLATFORM; #elif defined(XP_WIN) return WINDOWS_PLATFORM; diff --git a/toolkit/components/viewsource/content/viewPartialSource.xul b/toolkit/components/viewsource/content/viewPartialSource.xul index fdec367b1c..c51744fd21 100644 --- a/toolkit/components/viewsource/content/viewPartialSource.xul +++ b/toolkit/components/viewsource/content/viewPartialSource.xul @@ -1,8 +1,8 @@ <?xml version="1.0"?> -# -*- Mode: HTML -*- -# 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/. +<!-- -*- Mode: XML -*- + 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/. --> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://global/content/viewSource.css" type="text/css"?> @@ -99,10 +99,8 @@ label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;"/> <menuitem command="cmd_pagesetup" id="menu_pageSetup" label="&pageSetupCmd.label;" accesskey="&pageSetupCmd.accesskey;"/> -#ifndef XP_MACOSX <menuitem command="cmd_printpreview" id="menu_printPreview" label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;"/> -#endif <menuitem key="key_print" command="cmd_print" id="menu_print" label="&printCmd.label;" accesskey="&printCmd.accesskey;"/> <menuseparator/> diff --git a/toolkit/components/viewsource/content/viewSource.xul b/toolkit/components/viewsource/content/viewSource.xul index c6ca58234e..3ad45a9d9d 100644 --- a/toolkit/components/viewsource/content/viewSource.xul +++ b/toolkit/components/viewsource/content/viewSource.xul @@ -1,5 +1,5 @@ <?xml version="1.0"?> -# -*- Mode: HTML -*- +# -*- Mode: XML -*- # 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/. @@ -50,10 +50,6 @@ oncommand="document.getElementById('FindToolbar').onFindAgainCommand(false);"/> <command id="cmd_findPrevious" oncommand="document.getElementById('FindToolbar').onFindAgainCommand(true);"/> -#ifdef XP_MACOSX - <command id="cmd_findSelection" - oncommand="document.getElementById('FindToolbar').onFindSelectionCommand();"/> -#endif <command id="cmd_reload" oncommand="viewSourceChrome.reload();"/> <command id="cmd_goToLine" oncommand="viewSourceChrome.promptAndGoToLine();" disabled="true"/> <command id="cmd_highlightSyntax" oncommand="viewSourceChrome.toggleSyntaxHighlighting();"/> @@ -89,21 +85,13 @@ <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/> <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/> <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/> -#ifdef XP_MACOSX - <key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/> -#endif <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/> <key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/> <key keycode="VK_BACK" command="Browser:Back"/> <key keycode="VK_BACK" command="Browser:Forward" modifiers="shift"/> -#ifndef XP_MACOSX <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/> <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/> -#else - <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" /> - <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" /> -#endif #ifdef XP_UNIX <key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/> <key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/> @@ -150,10 +138,8 @@ label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;"/> <menuitem command="cmd_pagesetup" id="menu_pageSetup" label="&pageSetupCmd.label;" accesskey="&pageSetupCmd.accesskey;"/> -#ifndef XP_MACOSX <menuitem command="cmd_printpreview" id="menu_printPreview" label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;"/> -#endif <menuitem key="key_print" command="cmd_print" id="menu_print" label="&printCmd.label;" accesskey="&printCmd.accesskey;"/> <menuseparator/> diff --git a/toolkit/components/viewsource/jar.mn b/toolkit/components/viewsource/jar.mn index 00a1f19a46..33818ae0db 100644 --- a/toolkit/components/viewsource/jar.mn +++ b/toolkit/components/viewsource/jar.mn @@ -7,6 +7,6 @@ toolkit.jar: content/global/viewSource.js (content/viewSource.js) * content/global/viewSource.xul (content/viewSource.xul) content/global/viewPartialSource.js (content/viewPartialSource.js) -* content/global/viewPartialSource.xul (content/viewPartialSource.xul) + content/global/viewPartialSource.xul (content/viewPartialSource.xul) content/global/viewSourceUtils.js (content/viewSourceUtils.js) content/global/viewSource-content.js (content/viewSource-content.js) |