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

Unified Diff: Source/WebKit/chromium/src/ContextMenuClientImpl.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | « no previous file | Source/WebKit/chromium/src/DOMUtilitiesPrivate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
index 1244b64b6e9ed5f9dacd9e91eb58165e6323407b..b30ac919b4e119a987208a4c554c048fe1e78fe8 100644
--- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -294,17 +294,15 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM
}
if (r.isSelected()) {
- if (!r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag) || !static_cast<HTMLInputElement*>(r.innerNonSharedNode())->isPasswordField())
+ if (!r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag) || !toHTMLInputElement(r.innerNonSharedNode())->isPasswordField())
data.selectedText = selectedFrame->editor()->selectedText().stripWhiteSpace();
}
if (r.isContentEditable()) {
data.isEditable = true;
#if ENABLE(INPUT_SPEECH)
- if (r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag)) {
- data.isSpeechInputEnabled =
- static_cast<HTMLInputElement*>(r.innerNonSharedNode())->isSpeechEnabled();
- }
+ if (r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag))
+ data.isSpeechInputEnabled = toHTMLInputElement(r.innerNonSharedNode())->isSpeechEnabled();
#endif
// When Chrome enables asynchronous spellchecking, its spellchecker adds spelling markers to misspelled
// words and attaches suggestions to these markers in the background. Therefore, when a user right-clicks
@@ -339,7 +337,7 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM
}
HTMLFormElement* form = selectedFrame->selection()->currentForm();
if (form && r.innerNonSharedNode()->hasTagName(HTMLNames::inputTag)) {
- HTMLInputElement* selectedElement = static_cast<HTMLInputElement*>(r.innerNonSharedNode());
+ HTMLInputElement* selectedElement = toHTMLInputElement(r.innerNonSharedNode());
if (selectedElement) {
WebSearchableFormData ws = WebSearchableFormData(WebFormElement(form), WebInputElement(selectedElement));
if (ws.url().isValid())
« no previous file with comments | « no previous file | Source/WebKit/chromium/src/DOMUtilitiesPrivate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698