Bug 807893 part.1 Remove nsIWidget::BeginSecureInput() and nsIWidget::EndSecureInput() r=roc, sr=roc

This commit is contained in:
Masayuki Nakano 2013-05-25 01:27:52 +09:00
Родитель 1cf81aec6e
Коммит 98454102d1
9 изменённых файлов: 2 добавлений и 127 удалений

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

@ -90,7 +90,6 @@ private:
nsIContent* nsIMEStateManager::sContent = nullptr;
nsPresContext* nsIMEStateManager::sPresContext = nullptr;
bool nsIMEStateManager::sInstalledMenuKeyboardListener = false;
bool nsIMEStateManager::sInSecureInputMode = false;
bool nsIMEStateManager::sIsTestingIME = false;
nsTextStateManager* nsIMEStateManager::sTextStateObserver = nullptr;
@ -243,29 +242,6 @@ nsIMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
return NS_OK;
}
// Handle secure input mode for password field input.
bool contentIsPassword = false;
if (aContent && aContent->GetNameSpaceID() == kNameSpaceID_XHTML) {
if (aContent->Tag() == nsGkAtoms::input) {
nsAutoString type;
aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
contentIsPassword = type.LowerCaseEqualsLiteral("password");
}
}
if (sInSecureInputMode) {
if (!contentIsPassword) {
if (NS_SUCCEEDED(widget->EndSecureKeyboardInput())) {
sInSecureInputMode = false;
}
}
} else {
if (contentIsPassword) {
if (NS_SUCCEEDED(widget->BeginSecureKeyboardInput())) {
sInSecureInputMode = true;
}
}
}
IMEState newState = GetNewIMEState(aPresContext, aContent);
if (!focusActuallyChanging) {
// actual focus isn't changing, but if IME enabled state is changing,

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

@ -128,7 +128,6 @@ protected:
static nsIContent* sContent;
static nsPresContext* sPresContext;
static bool sInstalledMenuKeyboardListener;
static bool sInSecureInputMode;
static bool sIsTestingIME;
static nsTextStateManager* sTextStateObserver;

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

@ -519,9 +519,6 @@ public:
virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries);
NS_IMETHOD BeginSecureKeyboardInput();
NS_IMETHOD EndSecureKeyboardInput();
void HidePlugin();
void UpdatePluginPort();

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

@ -2343,34 +2343,6 @@ nsChildView::UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometri
[win setUnifiedToolbarHeight:DevPixelsToCocoaPoints(devUnifiedHeight)];
}
NS_IMETHODIMP
nsChildView::BeginSecureKeyboardInput()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
nsresult rv = nsBaseWidget::BeginSecureKeyboardInput();
if (NS_SUCCEEDED(rv)) {
::EnableSecureEventInput();
}
return rv;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
NS_IMETHODIMP
nsChildView::EndSecureKeyboardInput()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
nsresult rv = nsBaseWidget::EndSecureKeyboardInput();
if (NS_SUCCEEDED(rv)) {
::DisableSecureEventInput();
}
return rv;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
#ifdef ACCESSIBILITY
already_AddRefed<a11y::Accessible>
nsChildView::GetDocumentAccessible()

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

@ -316,8 +316,6 @@ public:
}
return mInputContext;
}
NS_IMETHOD BeginSecureKeyboardInput();
NS_IMETHOD EndSecureKeyboardInput();
void SetPopupWindowLevel();

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

@ -2029,32 +2029,6 @@ gfxASurface* nsCocoaWindow::GetThebesSurface()
return nullptr;
}
NS_IMETHODIMP nsCocoaWindow::BeginSecureKeyboardInput()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
nsresult rv = nsBaseWidget::BeginSecureKeyboardInput();
if (NS_SUCCEEDED(rv)) {
::EnableSecureEventInput();
}
return rv;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
NS_IMETHODIMP nsCocoaWindow::EndSecureKeyboardInput()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
nsresult rv = nsBaseWidget::EndSecureKeyboardInput();
if (NS_SUCCEEDED(rv)) {
::DisableSecureEventInput();
}
return rv;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
}
void nsCocoaWindow::SetPopupWindowLevel()
{
if (!mWindow)

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

@ -92,8 +92,8 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event);
#endif
#define NS_IWIDGET_IID \
{ 0xa7d1e8d4, 0xe2c1, 0x45cb, \
{ 0xab, 0x72, 0xb3, 0xe9, 0xf9, 0xcc, 0xb2, 0xce } }
{ 0x5b9152, 0x56c8, 0x4a2d, \
{ 0x94, 0x9e, 0xec, 0xf5, 0x3, 0x83, 0x3d, 0x48 } }
/*
* Window shadow styles
@ -1310,24 +1310,6 @@ class nsIWidget : public nsISupports {
*/
virtual bool HasPendingInputEvent() = 0;
/**
* Called when when we need to begin secure keyboard input, such as when a password field
* gets focus.
*
* NOTE: Calls to this method may not be nested and you can only enable secure keyboard input
* for one widget at a time.
*/
NS_IMETHOD BeginSecureKeyboardInput() = 0;
/**
* Called when when we need to end secure keyboard input, such as when a password field
* loses focus.
*
* NOTE: Calls to this method may not be nested and you can only enable secure keyboard input
* for one widget at a time.
*/
NS_IMETHOD EndSecureKeyboardInput() = 0;
/**
* Set the background color of the window titlebar for this widget. On Mac,
* for example, this will remove the grey gradient and bottom border and

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

@ -47,7 +47,6 @@
static void debug_RegisterPrefCallbacks();
static bool debug_InSecureKeyboardInputMode = false;
#endif
#ifdef NOISY_WIDGET_LEAKS
@ -1172,26 +1171,6 @@ nsBaseWidget::SetIcon(const nsAString&)
return NS_OK;
}
NS_IMETHODIMP
nsBaseWidget::BeginSecureKeyboardInput()
{
#ifdef DEBUG
NS_ASSERTION(!debug_InSecureKeyboardInputMode, "Attempting to nest call to BeginSecureKeyboardInput!");
debug_InSecureKeyboardInputMode = true;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsBaseWidget::EndSecureKeyboardInput()
{
#ifdef DEBUG
NS_ASSERTION(debug_InSecureKeyboardInputMode, "Calling EndSecureKeyboardInput when it hasn't been enabled!");
debug_InSecureKeyboardInputMode = false;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsBaseWidget::SetWindowTitlebarColor(nscolor aColor, bool aActive)
{

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

@ -148,8 +148,6 @@ public:
NS_IMETHOD GetAttention(int32_t aCycleCount);
virtual bool HasPendingInputEvent();
NS_IMETHOD SetIcon(const nsAString &anIconSpec);
NS_IMETHOD BeginSecureKeyboardInput();
NS_IMETHOD EndSecureKeyboardInput();
NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, bool aActive);
virtual void SetDrawsInTitlebar(bool aState) {}
virtual bool ShowsResizeIndicator(nsIntRect* aResizerRect);