Bug 1743914 - Part 3: Telemetry for when Firefox is the default handler. r=chutten,mhowell
This only records whether Firefox is the default PDF handler for now. But it will accommodate additional file types and protocols in the future, should they be desired. This is Windows 10+ only, since we really only care about PDF handling defaults where Edgium is the OS default. Differential Revision: https://phabricator.services.mozilla.com/D132659
This commit is contained in:
@@ -207,6 +207,32 @@ nsWindowsShellService::IsDefaultBrowser(bool aForAllTypes,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindowsShellService::IsDefaultHandlerFor(
|
||||
const nsAString& aFileExtensionOrProtocol, bool* aIsDefaultHandlerFor) {
|
||||
*aIsDefaultHandlerFor = false;
|
||||
|
||||
RefPtr<IApplicationAssociationRegistration> pAAR;
|
||||
HRESULT hr = CoCreateInstance(
|
||||
CLSID_ApplicationAssociationRegistration, nullptr, CLSCTX_INPROC,
|
||||
IID_IApplicationAssociationRegistration, getter_AddRefs(pAAR));
|
||||
if (FAILED(hr)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
wchar_t exePath[MAXPATHLEN] = L"";
|
||||
nsresult rv = BinaryPath::GetLong(exePath);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsString& flatClass = PromiseFlatString(aFileExtensionOrProtocol);
|
||||
|
||||
*aIsDefaultHandlerFor = IsPathDefaultForClass(pAAR, exePath, flatClass.get());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsWindowsShellService::LaunchControlPanelDefaultsSelectionUI() {
|
||||
IApplicationAssociationRegistrationUI* pAARUI;
|
||||
HRESULT hr = CoCreateInstance(
|
||||
|
||||
Reference in New Issue
Block a user