OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebForm_h | 31 #ifndef WebSecurityOrigin_h |
32 #define WebForm_h | 32 #define WebSecurityOrigin_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 | 35 |
36 #if WEBKIT_IMPLEMENTATION | 36 #if WEBKIT_IMPLEMENTATION |
37 namespace WebCore { class HTMLFormElement; } | 37 namespace WebCore { class SecurityOrigin; } |
38 namespace WTF { template <typename T> class PassRefPtr; } | 38 namespace WTF { template <typename T> class PassRefPtr; } |
39 #endif | 39 #endif |
40 | 40 |
41 namespace WebKit { | 41 namespace WebKit { |
42 class WebFormPrivate; | 42 class WebSecurityOriginPrivate; |
| 43 class WebString; |
43 | 44 |
44 // A container for passing around a reference to a form element. Provides | 45 class WebSecurityOrigin { |
45 // some information about the form. | |
46 class WebForm { | |
47 public: | 46 public: |
48 ~WebForm() { reset(); } | 47 ~WebSecurityOrigin() { reset(); } |
49 | 48 |
50 WebForm() : m_private(0) { } | 49 WebSecurityOrigin() : m_private(0) { } |
51 WebForm(const WebForm& f) : m_private(0) { assign(f); } | 50 WebSecurityOrigin(const WebSecurityOrigin& s) : m_private(0) { assign(s); } |
52 WebForm& operator=(const WebForm& f) { assign(f); return *this; } | 51 WebSecurityOrigin& operator=(const WebSecurityOrigin& s) { assign(s); return *this; } |
53 | 52 |
54 WEBKIT_API void reset(); | 53 WEBKIT_API void reset(); |
55 WEBKIT_API void assign(const WebForm&); | 54 WEBKIT_API void assign(const WebSecurityOrigin&); |
56 | 55 |
57 bool isNull() const { return m_private == 0; } | 56 bool isNull() const { return m_private == 0; } |
58 | 57 |
59 // Returns true if the form does not have "autocomplete=off" specified. | 58 WEBKIT_API WebString toString() const; |
60 WEBKIT_API bool isAutoCompleteEnabled() const; | |
61 | 59 |
62 #if WEBKIT_IMPLEMENTATION | 60 #if WEBKIT_IMPLEMENTATION |
63 WebForm(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); | 61 WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); |
64 WebForm& operator=(const WTF::PassRefPtr<WebCore::HTMLFormElement>&); | 62 WebSecurityOrigin& operator=(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); |
65 operator WTF::PassRefPtr<WebCore::HTMLFormElement>() const; | 63 operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const; |
66 #endif | 64 #endif |
67 | 65 |
68 private: | 66 private: |
69 void assign(WebFormPrivate*); | 67 void assign(WebSecurityOriginPrivate*); |
70 WebFormPrivate* m_private; | 68 WebSecurityOriginPrivate* m_private; |
71 }; | 69 }; |
72 | 70 |
73 } // namespace WebKit | 71 } // namespace WebKit |
74 | 72 |
75 #endif | 73 #endif |
OLD | NEW |