OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 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 #define HTMLDialogElement_h | 27 #define HTMLDialogElement_h |
28 | 28 |
29 #include "core/html/HTMLElement.h" | 29 #include "core/html/HTMLElement.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class Document; | 33 class Document; |
34 class ExceptionState; | 34 class ExceptionState; |
35 class QualifiedName; | 35 class QualifiedName; |
36 | 36 |
37 class HTMLDialogElement FINAL : public HTMLElement { | 37 class HTMLDialogElement final : public HTMLElement { |
38 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
39 public: | 39 public: |
40 DECLARE_NODE_FACTORY(HTMLDialogElement); | 40 DECLARE_NODE_FACTORY(HTMLDialogElement); |
41 | 41 |
42 void close(const String& returnValue, ExceptionState&); | 42 void close(const String& returnValue, ExceptionState&); |
43 void closeDialog(const String& returnValue = String()); | 43 void closeDialog(const String& returnValue = String()); |
44 void show(); | 44 void show(); |
45 void showModal(ExceptionState&); | 45 void showModal(ExceptionState&); |
46 virtual void removedFrom(ContainerNode*) OVERRIDE; | 46 virtual void removedFrom(ContainerNode*) override; |
47 | 47 |
48 // NotCentered means do not center the dialog. Centered means the dialog has | 48 // NotCentered means do not center the dialog. Centered means the dialog has |
49 // been centered and centeredPosition() is set. NeedsCentering means attempt | 49 // been centered and centeredPosition() is set. NeedsCentering means attempt |
50 // to center on the next layout, then set to Centered or NotCentered. | 50 // to center on the next layout, then set to Centered or NotCentered. |
51 enum CenteringMode { NotCentered, Centered, NeedsCentering }; | 51 enum CenteringMode { NotCentered, Centered, NeedsCentering }; |
52 CenteringMode centeringMode() const { return m_centeringMode; } | 52 CenteringMode centeringMode() const { return m_centeringMode; } |
53 LayoutUnit centeredPosition() const | 53 LayoutUnit centeredPosition() const |
54 { | 54 { |
55 ASSERT(m_centeringMode == Centered); | 55 ASSERT(m_centeringMode == Centered); |
56 return m_centeredPosition; | 56 return m_centeredPosition; |
57 } | 57 } |
58 void setCentered(LayoutUnit centeredPosition); | 58 void setCentered(LayoutUnit centeredPosition); |
59 void setNotCentered(); | 59 void setNotCentered(); |
60 | 60 |
61 String returnValue() const { return m_returnValue; } | 61 String returnValue() const { return m_returnValue; } |
62 void setReturnValue(const String& returnValue) { m_returnValue = returnValue
; } | 62 void setReturnValue(const String& returnValue) { m_returnValue = returnValue
; } |
63 | 63 |
64 private: | 64 private: |
65 explicit HTMLDialogElement(Document&); | 65 explicit HTMLDialogElement(Document&); |
66 | 66 |
67 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 67 virtual bool isPresentationAttribute(const QualifiedName&) const override; |
68 virtual void defaultEventHandler(Event*) OVERRIDE; | 68 virtual void defaultEventHandler(Event*) override; |
69 | 69 |
70 void forceLayoutForCentering(); | 70 void forceLayoutForCentering(); |
71 | 71 |
72 CenteringMode m_centeringMode; | 72 CenteringMode m_centeringMode; |
73 LayoutUnit m_centeredPosition; | 73 LayoutUnit m_centeredPosition; |
74 String m_returnValue; | 74 String m_returnValue; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace blink | 77 } // namespace blink |
78 | 78 |
79 #endif // HTMLDialogElement_h | 79 #endif // HTMLDialogElement_h |
OLD | NEW |