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

Unified Diff: Source/web/WebSearchableFormData.cpp

Issue 843683005: Fix a bit of C++11 in web/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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/web/WebRemoteFrameImpl.cpp ('k') | Source/web/WebSelectElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebSearchableFormData.cpp
diff --git a/Source/web/WebSearchableFormData.cpp b/Source/web/WebSearchableFormData.cpp
index d6a7c42bb474ed82b190a6861b3e3896fb30d890..d3bff706654828cc47a61fa786d92c3078c1eeba 100644
--- a/Source/web/WebSearchableFormData.cpp
+++ b/Source/web/WebSearchableFormData.cpp
@@ -81,15 +81,15 @@ bool IsHTTPFormSubmit(const HTMLFormElement* form)
// button is returned.
HTMLFormControlElement* GetButtonToActivate(HTMLFormElement* form)
{
- HTMLFormControlElement* firstSubmitButton = 0;
+ HTMLFormControlElement* firstSubmitButton = nullptr;
const FormAssociatedElement::List& element = form->associatedElements();
for (FormAssociatedElement::List::const_iterator i(element.begin()); i != element.end(); ++i) {
if (!(*i)->isFormControlElement())
continue;
HTMLFormControlElement* control = toHTMLFormControlElement(*i);
if (control->isActivatedSubmit()) {
- // There's a button that is already activated for submit, return 0.
- return 0;
+ // There's a button that is already activated for submit, return nullptr.
+ return nullptr;
}
if (!firstSubmitButton && control->isSuccessfulSubmitButton())
firstSubmitButton = control;
@@ -101,9 +101,9 @@ HTMLFormControlElement* GetButtonToActivate(HTMLFormElement* form)
// selected state.
bool IsSelectInDefaultState(HTMLSelectElement* select)
{
- const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
+ const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = select->listItems();
if (select->multiple() || select->size() > 1) {
- for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
+ for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
Mike West 2015/01/08 13:32:57 New loop style?
if (!isHTMLOptionElement(*i))
continue;
HTMLOptionElement* optionElement = toHTMLOptionElement(*i);
@@ -115,8 +115,8 @@ bool IsSelectInDefaultState(HTMLSelectElement* select)
// The select is rendered as a combobox (called menulist in WebKit). At
// least one item is selected, determine which one.
- HTMLOptionElement* initialSelected = 0;
- for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
+ HTMLOptionElement* initialSelected = nullptr;
+ for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
Mike West 2015/01/08 13:32:57 Here too?
if (!isHTMLOptionElement(*i))
continue;
HTMLOptionElement* optionElement = toHTMLOptionElement(*i);
@@ -156,7 +156,7 @@ bool IsInDefaultState(HTMLFormControlElement* formElement)
// - More than one text field
HTMLInputElement* findSuitableSearchInputElement(const HTMLFormElement* form)
{
- HTMLInputElement* textElement = 0;
+ HTMLInputElement* textElement = nullptr;
const FormAssociatedElement::List& element = form->associatedElements();
for (FormAssociatedElement::List::const_iterator i(element.begin()); i != element.end(); ++i) {
if (!(*i)->isFormControlElement())
@@ -168,20 +168,20 @@ HTMLInputElement* findSuitableSearchInputElement(const HTMLFormElement* form)
continue;
if (!IsInDefaultState(control) || isHTMLTextAreaElement(*control))
- return 0;
+ return nullptr;
if (isHTMLInputElement(*control) && control->willValidate()) {
const HTMLInputElement& input = toHTMLInputElement(*control);
// Return nothing if a file upload field or a password field are found.
if (input.type() == InputTypeNames::file || input.type() == InputTypeNames::password)
- return 0;
+ return nullptr;
if (input.isTextField()) {
if (textElement) {
// The auto-complete bar only knows how to fill in one value.
// This form has multiple fields; don't treat it as searchable.
- return 0;
+ return nullptr;
}
textElement = toHTMLInputElement(control);
}
@@ -234,8 +234,8 @@ bool buildSearchString(const HTMLFormElement* form, Vector<char>* encodedString,
WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const WebInputElement& selectedInputElement)
{
- RefPtrWillBeRawPtr<HTMLFormElement> formElement = static_cast<PassRefPtrWillBeRawPtr<HTMLFormElement> >(form);
- HTMLInputElement* inputElement = static_cast<PassRefPtrWillBeRawPtr<HTMLInputElement> >(selectedInputElement).get();
+ RefPtrWillBeRawPtr<HTMLFormElement> formElement = static_cast<PassRefPtrWillBeRawPtr<HTMLFormElement>>(form);
+ HTMLInputElement* inputElement = static_cast<PassRefPtrWillBeRawPtr<HTMLInputElement>>(selectedInputElement).get();
// Only consider forms that GET data.
// Allow HTTPS only when an input element is provided.
« no previous file with comments | « Source/web/WebRemoteFrameImpl.cpp ('k') | Source/web/WebSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698