| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 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 16 matching lines...) Expand all Loading... |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef FormState_h | 29 #ifndef FormState_h |
| 30 #define FormState_h | 30 #define FormState_h |
| 31 | 31 |
| 32 #include "PlatformString.h" | 32 #include "PlatformString.h" |
| 33 #include <wtf/RefCounted.h> | 33 #include <wtf/RefCounted.h> |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 class Frame; | 37 class Document; |
| 38 class HTMLFormElement; | 38 class HTMLFormElement; |
| 39 | 39 |
| 40 enum FormSubmissionTrigger { | 40 enum FormSubmissionTrigger { |
| 41 SubmittedByJavaScript, | 41 SubmittedByJavaScript, |
| 42 NotSubmittedByJavaScript | 42 NotSubmittedByJavaScript |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 typedef Vector<std::pair<String, String> > StringPairVector; | 45 typedef Vector<std::pair<String, String> > StringPairVector; |
| 46 | 46 |
| 47 class FormState : public RefCounted<FormState> { | 47 class FormState : public RefCounted<FormState> { |
| 48 public: | 48 public: |
| 49 static PassRefPtr<FormState> create(PassRefPtr<HTMLFormElement>, StringP
airVector& textFieldValuesToAdopt, PassRefPtr<Frame>, FormSubmissionTrigger); | 49 static PassRefPtr<FormState> create(PassRefPtr<HTMLFormElement>, StringP
airVector& textFieldValuesToAdopt, PassRefPtr<Document>, FormSubmissionTrigger); |
| 50 | 50 |
| 51 HTMLFormElement* form() const { return m_form.get(); } | 51 HTMLFormElement* form() const { return m_form.get(); } |
| 52 const StringPairVector& textFieldValues() const { return m_textFieldValu
es; } | 52 const StringPairVector& textFieldValues() const { return m_textFieldValu
es; } |
| 53 Frame* sourceFrame() const { return m_sourceFrame.get(); } | 53 Document* sourceDocument() const { return m_sourceDocument.get(); } |
| 54 FormSubmissionTrigger formSubmissionTrigger() const { return m_formSubmi
ssionTrigger; } | 54 FormSubmissionTrigger formSubmissionTrigger() const { return m_formSubmi
ssionTrigger; } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 FormState(PassRefPtr<HTMLFormElement>, StringPairVector& textFieldValues
ToAdopt, PassRefPtr<Frame>, FormSubmissionTrigger); | 57 FormState(PassRefPtr<HTMLFormElement>, StringPairVector& textFieldValues
ToAdopt, PassRefPtr<Document>, FormSubmissionTrigger); |
| 58 | 58 |
| 59 RefPtr<HTMLFormElement> m_form; | 59 RefPtr<HTMLFormElement> m_form; |
| 60 StringPairVector m_textFieldValues; | 60 StringPairVector m_textFieldValues; |
| 61 RefPtr<Frame> m_sourceFrame; | 61 RefPtr<Document> m_sourceDocument; |
| 62 FormSubmissionTrigger m_formSubmissionTrigger; | 62 FormSubmissionTrigger m_formSubmissionTrigger; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } | 65 } |
| 66 | 66 |
| 67 #endif // FormState_h | 67 #endif // FormState_h |
| OLD | NEW |