Bug 693227 - Remove nsIWindowsShellService.unreadMailCount. r=jimm

This commit is contained in:
Makoto Kato 2011-11-14 05:56:03 +01:00
Родитель 818235e696
Коммит c5da66020c
3 изменённых файлов: 1 добавлений и 70 удалений

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

@ -38,16 +38,9 @@
#include "nsIShellService.idl"
[scriptable, uuid(16e7e8da-8bef-4f41-be5f-045b2e9918e1)]
[scriptable, uuid(89b0a761-d9a0-4c39-ab83-d81566459a31)]
interface nsIWindowsShellService : nsIShellService
{
/**
* The number of unread mail messages for the current user.
*
* @return The number of unread (new) mail messages for the current user.
*/
readonly attribute unsigned long unreadMailCount;
/**
* Provides the shell service an opportunity to do some Win7+ shortcut
* maintenance needed on initial startup of the browser.

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

@ -803,66 +803,6 @@ nsWindowsShellService::SetDesktopBackgroundColor(PRUint32 aColor)
return NS_OK;
}
NS_IMETHODIMP
nsWindowsShellService::GetUnreadMailCount(PRUint32* aCount)
{
*aCount = 0;
HKEY accountKey;
if (GetMailAccountKey(&accountKey)) {
DWORD type, unreadCount;
DWORD len = sizeof unreadCount;
DWORD res = ::RegQueryValueExW(accountKey, L"MessageCount", 0,
&type, (LPBYTE)&unreadCount, &len);
if (REG_SUCCEEDED(res))
*aCount = unreadCount;
// Close the key we opened.
::RegCloseKey(accountKey);
}
return NS_OK;
}
bool
nsWindowsShellService::GetMailAccountKey(HKEY* aResult)
{
NS_NAMED_LITERAL_STRING(unread,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\UnreadMail\\");
HKEY mailKey;
DWORD res = ::RegOpenKeyExW(HKEY_CURRENT_USER, unread.get(), 0,
KEY_ENUMERATE_SUB_KEYS, &mailKey);
PRInt32 i = 0;
do {
PRUnichar subkeyName[MAX_BUF];
DWORD len = sizeof subkeyName;
res = ::RegEnumKeyExW(mailKey, i++, subkeyName, &len, NULL, NULL,
NULL, NULL);
if (REG_SUCCEEDED(res)) {
HKEY accountKey;
res = ::RegOpenKeyExW(mailKey, PromiseFlatString(subkeyName).get(),
0, KEY_READ, &accountKey);
if (REG_SUCCEEDED(res)) {
*aResult = accountKey;
// Close the key we opened.
::RegCloseKey(mailKey);
return true;
}
}
else
break;
}
while (1);
// Close the key we opened.
::RegCloseKey(mailKey);
return false;
}
NS_IMETHODIMP
nsWindowsShellService::OpenApplicationWithURI(nsILocalFile* aApplication,
const nsACString& aURI)

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

@ -59,8 +59,6 @@ public:
protected:
bool IsDefaultBrowserVista(bool* aIsDefaultBrowser);
bool GetMailAccountKey(HKEY* aResult);
private:
bool mCheckedThisSession;
};