From 306ca78c3d2d1b7a247d670c26d2dd719b8df4da Mon Sep 17 00:00:00 2001 From: Geoff Lankow Date: Tue, 28 Jul 2020 15:27:12 +1200 Subject: [PATCH] Bug 1655463 - Convert callers of nsIWindowWatcher.openWindow to use const nsACString&. rs=bustage-fix DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D85103 --HG-- extra : rebase_source : a5e62155ba25c3a49b1fd0aadc6936b67d7b7958 extra : amend_source : fd5e668c657d860ba1daf39665c7c9e24a811c1e --- .../migration/src/nsProfileMigrator.cpp | 6 +++--- mailnews/base/src/nsMessengerBootstrap.cpp | 4 ++-- mailnews/base/src/nsMessengerContentHandler.cpp | 7 ++++--- mailnews/base/src/nsMessengerOSXIntegration.mm | 8 ++++---- mailnews/base/src/nsMessengerUnixIntegration.cpp | 8 ++++---- mailnews/base/src/nsMessengerWinIntegration.cpp | 6 +++--- mailnews/compose/src/nsMsgComposeService.cpp | 16 +++++++++++----- mailnews/news/src/nsNntpService.cpp | 9 +++++---- 8 files changed, 36 insertions(+), 28 deletions(-) diff --git a/mail/components/migration/src/nsProfileMigrator.cpp b/mail/components/migration/src/nsProfileMigrator.cpp index 07b6012610..0970451444 100644 --- a/mail/components/migration/src/nsProfileMigrator.cpp +++ b/mail/components/migration/src/nsProfileMigrator.cpp @@ -29,8 +29,8 @@ NS_IMPL_ISUPPORTS(nsProfileMigrator, nsIProfileMigrator) #define MIGRATION_WIZARD_FE_URL \ - "chrome://messenger/content/migration/migration.xhtml" -#define MIGRATION_WIZARD_FE_FEATURES "chrome,dialog,modal,centerscreen" + "chrome://messenger/content/migration/migration.xhtml"_ns +#define MIGRATION_WIZARD_FE_FEATURES "chrome,dialog,modal,centerscreen"_ns NS_IMETHODIMP nsProfileMigrator::Migrate(nsIProfileStartup* aStartup, const nsACString& aKey, @@ -57,7 +57,7 @@ nsProfileMigrator::Migrate(nsIProfileStartup* aStartup, const nsACString& aKey, params->AppendElement(aStartup); nsCOMPtr migrateWizard; - return ww->OpenWindow(nullptr, MIGRATION_WIZARD_FE_URL, "_blank", + return ww->OpenWindow(nullptr, MIGRATION_WIZARD_FE_URL, "_blank"_ns, MIGRATION_WIZARD_FE_FEATURES, params, getter_AddRefs(migrateWizard)); } diff --git a/mailnews/base/src/nsMessengerBootstrap.cpp b/mailnews/base/src/nsMessengerBootstrap.cpp index 9ece50cbf3..cca4bb9b71 100644 --- a/mailnews/base/src/nsMessengerBootstrap.cpp +++ b/mailnews/base/src/nsMessengerBootstrap.cpp @@ -78,7 +78,7 @@ NS_IMETHODIMP nsMessengerBootstrap::OpenMessengerWindowWithUri( // we need to use the "mailnews.reuse_thread_window2" pref // to determine if we should open a new window, or use an existing one. nsCOMPtr newWindow; - return wwatch->OpenWindow(0, chromeUrl.get(), "_blank", - "chrome,all,dialog=no", argsArray, + return wwatch->OpenWindow(0, chromeUrl, "_blank"_ns, + "chrome,all,dialog=no"_ns, argsArray, getter_AddRefs(newWindow)); } diff --git a/mailnews/base/src/nsMessengerContentHandler.cpp b/mailnews/base/src/nsMessengerContentHandler.cpp index 1654b38a5d..4b0da42b78 100644 --- a/mailnews/base/src/nsMessengerContentHandler.cpp +++ b/mailnews/base/src/nsMessengerContentHandler.cpp @@ -85,7 +85,8 @@ nsresult nsMessengerContentHandler::OpenWindow(nsIURI* aURI) { if (!wwatch) return NS_ERROR_FAILURE; nsCOMPtr newWindow; - return wwatch->OpenWindow(0, "chrome://messenger/content/messageWindow.xhtml", - "_blank", "all,chrome,dialog=no,status,toolbar", - aURI, getter_AddRefs(newWindow)); + return wwatch->OpenWindow( + 0, "chrome://messenger/content/messageWindow.xhtml"_ns, "_blank"_ns, + "all,chrome,dialog=no,status,toolbar"_ns, aURI, + getter_AddRefs(newWindow)); } diff --git a/mailnews/base/src/nsMessengerOSXIntegration.mm b/mailnews/base/src/nsMessengerOSXIntegration.mm index ddfe13d70b..5872771400 100644 --- a/mailnews/base/src/nsMessengerOSXIntegration.mm +++ b/mailnews/base/src/nsMessengerOSXIntegration.mm @@ -98,8 +98,8 @@ static void openMailWindow(const nsCString& aUri) { // bug 507593 is implemented. #ifdef MOZ_SUITE nsCOMPtr newWindow; - wwatch->OpenWindow(0, "chrome://messenger/content/messageWindow.xhtml", "_blank", - "all,chrome,dialog=no,status,toolbar", msgUri, + wwatch->OpenWindow(0, "chrome://messenger/content/messageWindow.xhtml"_ns, "_blank"_ns, + "all,chrome,dialog=no,status,toolbar"_ns, msgUri, getter_AddRefs(newWindow)); #else nsCOMPtr messenger(do_CreateInstance(NS_MESSENGER_CONTRACTID, &rv)); @@ -109,8 +109,8 @@ static void openMailWindow(const nsCString& aUri) { messenger->MsgHdrFromURI(aUri, getter_AddRefs(msgHdr)); if (msgHdr) { nsCOMPtr newWindow; - wwatch->OpenWindow(0, "chrome://messenger/content/messageWindow.xhtml", "_blank", - "all,chrome,dialog=no,status,toolbar", msgHdr, + wwatch->OpenWindow(0, "chrome://messenger/content/messageWindow.xhtml"_ns, "_blank"_ns, + "all,chrome,dialog=no,status,toolbar"_ns, msgHdr, getter_AddRefs(newWindow)); } #endif diff --git a/mailnews/base/src/nsMessengerUnixIntegration.cpp b/mailnews/base/src/nsMessengerUnixIntegration.cpp index 64719af50f..a11bf6f8cf 100644 --- a/mailnews/base/src/nsMessengerUnixIntegration.cpp +++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp @@ -50,7 +50,7 @@ #include "mozilla/Services.h" #include "mozilla/mailnews/MimeHeaderParser.h" -#define ALERT_CHROME_URL "chrome://messenger/content/newmailalert.xhtml" +#define ALERT_CHROME_URL "chrome://messenger/content/newmailalert.xhtml"_ns #define NEW_MAIL_ALERT_ICON "chrome://messenger/skin/icons/new-mail-alert.png" #define SHOW_ALERT_PREF "mail.biff.show_alert" #define SHOW_ALERT_PREVIEW_LENGTH "mail.biff.alert.preview_length" @@ -366,9 +366,9 @@ nsresult nsMessengerUnixIntegration::ShowNewAlertNotification( nsCOMPtr newWindow; mAlertInProgress = true; - rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank", - "chrome,dialog=yes,titlebar=no,popup=yes", argsArray, - getter_AddRefs(newWindow)); + rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank"_ns, + "chrome,dialog=yes,titlebar=no,popup=yes"_ns, + argsArray, getter_AddRefs(newWindow)); if (NS_FAILED(rv)) AlertFinished(); diff --git a/mailnews/base/src/nsMessengerWinIntegration.cpp b/mailnews/base/src/nsMessengerWinIntegration.cpp index 7a84bfd7d2..4a5c9593e8 100644 --- a/mailnews/base/src/nsMessengerWinIntegration.cpp +++ b/mailnews/base/src/nsMessengerWinIntegration.cpp @@ -60,7 +60,7 @@ #define MAIL_COMMANDLINE_ARG u" -mail" #define IDI_MAILBIFF 32576 #define UNREAD_UPDATE_INTERVAL (20 * 1000) // 20 seconds -#define ALERT_CHROME_URL "chrome://messenger/content/newmailalert.xhtml" +#define ALERT_CHROME_URL "chrome://messenger/content/newmailalert.xhtml"_ns #define NEW_MAIL_ALERT_ICON "chrome://messenger/skin/icons/new-mail-alert.png" #define SHOW_ALERT_PREF "mail.biff.show_alert" #define SHOW_TRAY_ICON_PREF "mail.biff.show_tray_icon" @@ -510,8 +510,8 @@ nsresult nsMessengerWinIntegration::ShowNewAlertNotification( nsCOMPtr wwatch( do_GetService(NS_WINDOWWATCHER_CONTRACTID)); nsCOMPtr newWindow; - rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank", - "chrome,dialog=yes,titlebar=no,popup=yes", + rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank"_ns, + "chrome,dialog=yes,titlebar=no,popup=yes"_ns, argsArray, getter_AddRefs(newWindow)); mAlertInProgress = true; diff --git a/mailnews/compose/src/nsMsgComposeService.cpp b/mailnews/compose/src/nsMsgComposeService.cpp index 41fec2545b..df28734b60 100644 --- a/mailnews/compose/src/nsMsgComposeService.cpp +++ b/mailnews/compose/src/nsMsgComposeService.cpp @@ -72,7 +72,7 @@ #endif #define DEFAULT_CHROME \ - "chrome://messenger/content/messengercompose/messengercompose.xhtml" + "chrome://messenger/content/messengercompose/messengercompose.xhtml"_ns #define PREF_MAILNEWS_REPLY_QUOTING_SELECTION "mailnews.reply_quoting_selection" #define PREF_MAILNEWS_REPLY_QUOTING_SELECTION_MULTI_WORD \ @@ -177,8 +177,14 @@ nsMsgComposeService::OpenComposeWindowWithParams(const char* chrome, msgParamsWrapper->SetDataIID(&NS_GET_IID(nsIMsgComposeParams)); nsCOMPtr newWindow; - rv = wwatch->OpenWindow(0, chrome && *chrome ? chrome : DEFAULT_CHROME, - "_blank", "all,chrome,dialog=no,status,toolbar", + nsAutoCString chromeURL; + if (chrome && *chrome) { + chromeURL = nsDependentCString(chrome); + } else { + chromeURL = DEFAULT_CHROME; + } + rv = wwatch->OpenWindow(0, chromeURL, "_blank"_ns, + "all,chrome,dialog=no,status,toolbar"_ns, msgParamsWrapper, getter_AddRefs(newWindow)); return rv; @@ -1388,8 +1394,8 @@ nsMsgComposeService::Handle(nsICommandLine* aCmdLine) { if (arg) arg->SetData(uristr); nsCOMPtr opened; - wwatch->OpenWindow(nullptr, DEFAULT_CHROME, "_blank", - "chrome,dialog=no,all", arg, getter_AddRefs(opened)); + wwatch->OpenWindow(nullptr, DEFAULT_CHROME, "_blank"_ns, + "chrome,dialog=no,all"_ns, arg, getter_AddRefs(opened)); aCmdLine->SetPreventDefault(true); } diff --git a/mailnews/news/src/nsNntpService.cpp b/mailnews/news/src/nsNntpService.cpp index e7772fd58b..9bbdee1805 100644 --- a/mailnews/news/src/nsNntpService.cpp +++ b/mailnews/news/src/nsNntpService.cpp @@ -1526,8 +1526,8 @@ nsNntpService::Handle(nsICommandLine* aCmdLine) { nsCOMPtr opened; wwatch->OpenWindow( - nullptr, "chrome://messenger/content/messenger.xhtml", "_blank", - "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar", + nullptr, "chrome://messenger/content/messenger.xhtml"_ns, "_blank"_ns, + "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar"_ns, nullptr, getter_AddRefs(opened)); aCmdLine->SetPreventDefault(true); } @@ -1596,8 +1596,9 @@ nsNntpService::HandleContent(const char* aContentType, nsCOMPtr newWindow; rv = wwatcher->OpenWindow( - nullptr, "chrome://messenger/content/messenger.xhtml", "_blank", - "chome,all,dialog=no", arg, getter_AddRefs(newWindow)); + nullptr, "chrome://messenger/content/messenger.xhtml"_ns, + "_blank"_ns, "chome,all,dialog=no"_ns, arg, + getter_AddRefs(newWindow)); NS_ENSURE_SUCCESS(rv, rv); } }