Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Unified Diff: Source/core/html/forms/PasswordInputType.cpp

Issue 27746003: Have InputType factories take an HTMLInputElement reference in parameter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/forms/PasswordInputType.h ('k') | Source/core/html/forms/RadioInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/PasswordInputType.cpp
diff --git a/Source/core/html/forms/PasswordInputType.cpp b/Source/core/html/forms/PasswordInputType.cpp
index 857cd1d3de485675ae41df5449035b06badcd0cd..ddab74573f82a0fb526247c3c1f1b264bcd5c65c 100644
--- a/Source/core/html/forms/PasswordInputType.cpp
+++ b/Source/core/html/forms/PasswordInputType.cpp
@@ -47,7 +47,7 @@
namespace WebCore {
-PassRefPtr<InputType> PasswordInputType::create(HTMLInputElement* element)
+PassRefPtr<InputType> PasswordInputType::create(HTMLInputElement& element)
{
return adoptRef(new PasswordInputType(element));
}
@@ -61,14 +61,14 @@ bool PasswordInputType::isPasswordGenerationEnabled() const
{
if (isPasswordGenerationDecorationEnabled())
return true;
- if (Page* page = element()->document().page())
+ if (Page* page = element().document().page())
return page->chrome().client().isPasswordGenerationEnabled();
return false;
}
bool PasswordInputType::isPasswordGenerationDecorationEnabled() const
{
- if (Page* page = element()->document().page())
+ if (Page* page = element().document().page())
return page->settings().passwordGenerationDecorationEnabled();
return false;
}
@@ -83,18 +83,18 @@ void PasswordInputType::createShadowSubtree()
BaseTextInputType::createShadowSubtree();
if (!isPasswordGenerationEnabled())
return;
- ShadowRoot* root = element()->userAgentShadowRoot();
- RefPtr<HTMLDivElement> wrapper = HTMLDivElement::create(element()->document());
+ ShadowRoot* root = element().userAgentShadowRoot();
+ RefPtr<HTMLDivElement> wrapper = HTMLDivElement::create(element().document());
wrapper->setInlineStyleProperty(CSSPropertyDisplay, CSSValueFlex);
wrapper->setInlineStyleProperty(CSSPropertyAlignItems, CSSValueCenter);
ASSERT(root->childNodeCount() == 1);
root->firstElementChild()->setInlineStyleProperty(CSSPropertyFlexGrow, 1.0, CSSPrimitiveValue::CSS_NUMBER);
wrapper->appendChild(root->firstElementChild());
- m_generatorButton = PasswordGeneratorButtonElement::create(element()->document());
+ m_generatorButton = PasswordGeneratorButtonElement::create(element().document());
if (!isPasswordGenerationDecorationEnabled())
m_generatorButton->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone);
wrapper->appendChild(m_generatorButton.get());
- element()->userAgentShadowRoot()->appendChild(wrapper);
+ element().userAgentShadowRoot()->appendChild(wrapper);
}
void PasswordInputType::destroyShadowSubtree()
@@ -155,14 +155,14 @@ bool PasswordInputType::isPasswordField() const
void PasswordInputType::enableSecureTextInput()
{
- if (element()->document().frame())
- element()->document().setUseSecureKeyboardEntryWhenActive(true);
+ if (element().document().frame())
+ element().document().setUseSecureKeyboardEntryWhenActive(true);
}
void PasswordInputType::disableSecureTextInput()
{
- if (element()->document().frame())
- element()->document().setUseSecureKeyboardEntryWhenActive(false);
+ if (element().document().frame())
+ element().document().setUseSecureKeyboardEntryWhenActive(false);
}
} // namespace WebCore
« no previous file with comments | « Source/core/html/forms/PasswordInputType.h ('k') | Source/core/html/forms/RadioInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698