Bug 772327 - Password mask timer is too short on Android. r=blassy

This commit is contained in:
Makoto Kato 2012-07-13 11:26:20 +09:00
Родитель 9516da73ae
Коммит 9d8f7a0477
6 изменённых файлов: 28 добавлений и 1 удалений

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

@ -648,7 +648,8 @@ nsTextEditRules::WillInsertText(nsEditor::OperationID aAction,
mTimer = do_CreateInstance("@mozilla.org/timer;1", &res);
NS_ENSURE_SUCCESS(res, res);
}
mTimer->InitWithCallback(this, 600, nsITimer::TYPE_ONE_SHOT);
mTimer->InitWithCallback(this, LookAndFeel::GetPasswordMaskDelay(),
nsITimer::TYPE_ONE_SHOT);
}
else
{

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

@ -505,6 +505,12 @@ public:
*/
static bool GetEchoPassword();
/**
* The millisecond to mask password value.
* This value is only valid when GetEchoPassword() returns true.
*/
static PRUint32 GetPasswordMaskDelay();
/**
* When system look and feel is changed, Refresh() must be called. Then,
* cached data would be released.

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

@ -472,3 +472,10 @@ nsLookAndFeel::GetEchoPasswordImpl()
}
return mShowPassword;
}
PRUint32
nsLookAndFeel::GetPasswordMaskDelayImpl()
{
// This value is hard-coded in PasswordTransformationMethod.java
return 1500;
}

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

@ -19,6 +19,7 @@ public:
virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
virtual bool GetFontImpl(FontID aID, nsString& aName, gfxFontStyle& aStyle);
virtual bool GetEchoPasswordImpl();
virtual PRUint32 GetPasswordMaskDelayImpl();
protected:
static bool mInitializedSystemColors;

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

@ -728,6 +728,13 @@ LookAndFeel::GetEchoPassword()
return nsLookAndFeel::GetInstance()->GetEchoPasswordImpl();
}
// static
PRUint32
LookAndFeel::GetPasswordMaskDelay()
{
return nsLookAndFeel::GetInstance()->GetPasswordMaskDelayImpl();
}
// static
void
LookAndFeel::Refresh()

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

@ -73,6 +73,11 @@ public:
return false;
}
virtual PRUint32 GetPasswordMaskDelayImpl()
{
return 600;
}
protected:
nsXPLookAndFeel();