Backed out changeset 8bd40784fb5b (bug 986975) for bustage

--HG--
extra : rebase_source : 7a8d7bb32446c179d413663091fb475f2d381bd3
This commit is contained in:
Carsten "Tomcat" Book 2017-04-24 11:59:04 +02:00
Родитель cc13ab1fa1
Коммит 589e3693ed
2 изменённых файлов: 23 добавлений и 27 удалений

Просмотреть файл

@ -55,20 +55,19 @@ nsAndroidHandlerApp::SetDetailedDescription(const nsAString & aDescription)
return NS_OK;
}
// XXX Workaround for bug 986975 to maintain the existing broken semantics
template<>
struct nsISharingHandlerApp::COMTypeInfo<nsAndroidHandlerApp, void> {
static const nsIID kIID;
};
const nsIID nsISharingHandlerApp::COMTypeInfo<nsAndroidHandlerApp, void>::kIID = NS_IHANDLERAPP_IID;
NS_IMETHODIMP
nsAndroidHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *aRetval)
{
*aRetval = false;
if (!aHandlerApp) {
return NS_OK;
}
nsAutoString name;
nsAutoString detailedDescription;
aHandlerApp->GetName(name);
aHandlerApp->GetDetailedDescription(detailedDescription);
*aRetval = name.Equals(mName) && detailedDescription.Equals(mDescription);
nsCOMPtr<nsAndroidHandlerApp> aApp = do_QueryInterface(aHandlerApp);
*aRetval = aApp && aApp->mName.Equals(mName) &&
aApp->mDescription.Equals(mDescription);
return NS_OK;
}

Просмотреть файл

@ -380,13 +380,11 @@ nsMIMEInfoAndroid::nsMIMEInfoAndroid(const nsACString& aMIMEType) :
mHandlerApps->AppendElement(mPrefApp, false);
}
#define SYSTEMCHOOSER_NAME u"Android chooser"
#define SYSTEMCHOOSER_DESCRIPTION u"Android's default handler application chooser"
NS_IMPL_ISUPPORTS(nsMIMEInfoAndroid::SystemChooser, nsIHandlerApp)
nsresult nsMIMEInfoAndroid::SystemChooser::GetName(nsAString & aName) {
aName.AssignLiteral(SYSTEMCHOOSER_NAME);
aName.AssignLiteral(u"Android chooser");
return NS_OK;
}
@ -397,7 +395,7 @@ nsMIMEInfoAndroid::SystemChooser::SetName(const nsAString&) {
nsresult
nsMIMEInfoAndroid::SystemChooser::GetDetailedDescription(nsAString & aDesc) {
aDesc.AssignLiteral(SYSTEMCHOOSER_DESCRIPTION);
aDesc.AssignLiteral(u"Android's default handler application chooser");
return NS_OK;
}
@ -406,20 +404,19 @@ nsMIMEInfoAndroid::SystemChooser::SetDetailedDescription(const nsAString&) {
return NS_OK;
}
// XXX Workaround for bug 986975 to maintain the existing broken semantics
template<>
struct nsIHandlerApp::COMTypeInfo<nsMIMEInfoAndroid::SystemChooser, void> {
static const nsIID kIID;
};
const nsIID nsIHandlerApp::COMTypeInfo<nsMIMEInfoAndroid::SystemChooser, void>::kIID = NS_IHANDLERAPP_IID;
nsresult
nsMIMEInfoAndroid::SystemChooser::Equals(nsIHandlerApp *aHandlerApp, bool *aRetVal) {
nsCOMPtr<nsMIMEInfoAndroid::SystemChooser> info = do_QueryInterface(aHandlerApp);
if (info)
return mOuter->Equals(info->mOuter, aRetVal);
*aRetVal = false;
if (!aHandlerApp) {
return NS_OK;
}
nsAutoString name;
nsAutoString detailedDescription;
aHandlerApp->GetName(name);
aHandlerApp->GetDetailedDescription(detailedDescription);
*aRetVal = name.EqualsLiteral(SYSTEMCHOOSER_NAME) &&
detailedDescription.EqualsLiteral(SYSTEMCHOOSER_DESCRIPTION);
return NS_OK;
}