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

Side by Side Diff: Source/core/html/forms/ResetInputType.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/ResetInputType.h ('k') | Source/core/html/forms/SearchInputType.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 23 matching lines...) Expand all
34 34
35 #include "core/events/Event.h" 35 #include "core/events/Event.h"
36 #include "core/html/HTMLFormElement.h" 36 #include "core/html/HTMLFormElement.h"
37 #include "core/html/HTMLInputElement.h" 37 #include "core/html/HTMLInputElement.h"
38 #include "core/html/forms/InputTypeNames.h" 38 #include "core/html/forms/InputTypeNames.h"
39 #include "platform/text/PlatformLocale.h" 39 #include "platform/text/PlatformLocale.h"
40 #include "wtf/PassOwnPtr.h" 40 #include "wtf/PassOwnPtr.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 PassRefPtr<InputType> ResetInputType::create(HTMLInputElement* element) 44 PassRefPtr<InputType> ResetInputType::create(HTMLInputElement& element)
45 { 45 {
46 return adoptRef(new ResetInputType(element)); 46 return adoptRef(new ResetInputType(element));
47 } 47 }
48 48
49 const AtomicString& ResetInputType::formControlType() const 49 const AtomicString& ResetInputType::formControlType() const
50 { 50 {
51 return InputTypeNames::reset(); 51 return InputTypeNames::reset();
52 } 52 }
53 53
54 bool ResetInputType::supportsValidation() const 54 bool ResetInputType::supportsValidation() const
55 { 55 {
56 return false; 56 return false;
57 } 57 }
58 58
59 void ResetInputType::handleDOMActivateEvent(Event* event) 59 void ResetInputType::handleDOMActivateEvent(Event* event)
60 { 60 {
61 if (element()->isDisabledFormControl() || !element()->form()) 61 if (element().isDisabledFormControl() || !element().form())
62 return; 62 return;
63 element()->form()->reset(); 63 element().form()->reset();
64 event->setDefaultHandled(); 64 event->setDefaultHandled();
65 } 65 }
66 66
67 String ResetInputType::defaultValue() const 67 String ResetInputType::defaultValue() const
68 { 68 {
69 return locale().queryString(WebKit::WebLocalizedString::ResetButtonDefaultLa bel); 69 return locale().queryString(WebKit::WebLocalizedString::ResetButtonDefaultLa bel);
70 } 70 }
71 71
72 bool ResetInputType::isTextButton() const 72 bool ResetInputType::isTextButton() const
73 { 73 {
74 return true; 74 return true;
75 } 75 }
76 76
77 } // namespace WebCore 77 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/ResetInputType.h ('k') | Source/core/html/forms/SearchInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698