Bug 756384 - Maemo/Meego builds should have the "Mobile" token in the UA string. r=mfinkle

This commit is contained in:
Oleg Romashin 2012-05-19 11:31:17 -04:00
parent bcb461bbc5
commit 5afbe4e354
2 changed files with 16 additions and 2 deletions

View File

@ -654,7 +654,7 @@ nsHttpHandler::BuildUserAgent()
mUserAgent += mPlatform;
mUserAgent.AppendLiteral("; ");
#endif
#ifdef ANDROID
#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
if (!mCompatDevice.IsEmpty()) {
mUserAgent += mCompatDevice;
mUserAgent.AppendLiteral("; ");
@ -712,7 +712,7 @@ nsHttpHandler::InitUserAgentComponents()
#endif
);
#if defined(ANDROID)
#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
NS_ASSERTION(infoService, "Could not find a system info service");

View File

@ -162,6 +162,7 @@ nsSystemInfo::Init()
SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N900"));
SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("RX-51"));
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
break;
} else if (strstr(line, "RX-44") ||
strstr(line, "RX-48") ||
@ -170,6 +171,19 @@ nsSystemInfo::Init()
SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N8xx"));
SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("N8xx"));
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
break;
} else if (strstr(line, "RM-680")) {
SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N950"));
SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("N9xx"));
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
break;
} else if (strstr(line, "RM-696")) {
SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N9"));
SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("N9xx"));
SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
break;
}
}