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

Side by Side Diff: third_party/WebKit/Source/core/html/shadow/TextControlInnerElements.cpp

Issue 2252423002: Refactoring button field and its type (2nd try) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 { 184 {
185 // If the element is visible, on mouseup, clear the value, and set selection 185 // If the element is visible, on mouseup, clear the value, and set selection
186 HTMLInputElement* input(toHTMLInputElement(shadowHost())); 186 HTMLInputElement* input(toHTMLInputElement(shadowHost()));
187 if (!input || input->isDisabledOrReadOnly()) { 187 if (!input || input->isDisabledOrReadOnly()) {
188 if (!event->defaultHandled()) 188 if (!event->defaultHandled())
189 HTMLDivElement::defaultEventHandler(event); 189 HTMLDivElement::defaultEventHandler(event);
190 return; 190 return;
191 } 191 }
192 192
193 193
194 if (event->type() == EventTypeNames::click && event->isMouseEvent() && toMou seEvent(event)->button() == LeftButton) { 194 if (event->type() == EventTypeNames::click && event->isMouseEvent() && toMou seEvent(event)->button() == static_cast<short>(WebPointerProperties::Button::Lef t)) {
195 input->setValueForUser(""); 195 input->setValueForUser("");
196 input->setAutofilled(false); 196 input->setAutofilled(false);
197 input->onSearch(); 197 input->onSearch();
198 event->setDefaultHandled(); 198 event->setDefaultHandled();
199 } 199 }
200 200
201 if (!event->defaultHandled()) 201 if (!event->defaultHandled())
202 HTMLDivElement::defaultEventHandler(event); 202 HTMLDivElement::defaultEventHandler(event);
203 } 203 }
204 204
205 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() 205 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents()
206 { 206 {
207 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); 207 const HTMLInputElement* input = toHTMLInputElement(shadowHost());
208 if (input && !input->isDisabledOrReadOnly()) 208 if (input && !input->isDisabledOrReadOnly())
209 return true; 209 return true;
210 210
211 return HTMLDivElement::willRespondToMouseClickEvents(); 211 return HTMLDivElement::willRespondToMouseClickEvents();
212 } 212 }
213 213
214 } // namespace blink 214 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698