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
parent 58d773ea44
commit 578f93622b
6 changed files with 28 additions and 1 deletions

View File

@ -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
{

View File

@ -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.

View File

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

View File

@ -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;

View File

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

View File

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