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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLDialogElement.h

Issue 2560553002: Add DialogShowParams to <dialog>'s show() and showModal() (Closed)
Patch Set: merge & rename Created 3 years, 12 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) 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 12 matching lines...) Expand all
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef HTMLDialogElement_h 26 #ifndef HTMLDialogElement_h
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 DialogShowParams;
33 class Document; 34 class Document;
34 class ExceptionState; 35 class ExceptionState;
35 class QualifiedName; 36 class QualifiedName;
36 37
37 class HTMLDialogElement final : public HTMLElement { 38 class HTMLDialogElement final : public HTMLElement {
38 DEFINE_WRAPPERTYPEINFO(); 39 DEFINE_WRAPPERTYPEINFO();
39 40
40 public: 41 public:
41 DECLARE_NODE_FACTORY(HTMLDialogElement); 42 DECLARE_NODE_FACTORY(HTMLDialogElement);
42 43
43 void close(const String& returnValue, ExceptionState&); 44 void close(const String& returnValue, ExceptionState&);
44 void closeDialog(const String& returnValue = String()); 45 void closeDialog(const String& returnValue = String());
45 void show(); 46 void show(const DialogShowParams&);
46 void showModal(ExceptionState&); 47 void showModal(const DialogShowParams&, ExceptionState&);
47 void removedFrom(ContainerNode*) override; 48 void removedFrom(ContainerNode*) override;
48 49
49 // NotCentered means do not center the dialog. Centered means the dialog has 50 // NotCentered means do not center the dialog. Centered means the dialog has
50 // been centered and centeredPosition() is set. NeedsCentering means attempt 51 // been centered and centeredPosition() is set. NeedsCentering means attempt
51 // to center on the next layout, then set to Centered or NotCentered. 52 // to center on the next layout, then set to Centered or NotCentered.
52 enum CenteringMode { NotCentered, Centered, NeedsCentering }; 53 enum CenteringMode { NotCentered, Centered, NeedsCentering };
53 CenteringMode getCenteringMode() const { return m_centeringMode; } 54 CenteringMode getCenteringMode() const { return m_centeringMode; }
54 LayoutUnit centeredPosition() const { 55 LayoutUnit centeredPosition() const {
55 DCHECK_EQ(m_centeringMode, Centered); 56 DCHECK_EQ(m_centeringMode, Centered);
56 return m_centeredPosition; 57 return m_centeredPosition;
(...skipping 17 matching lines...) Expand all
74 void scheduleCloseEvent(); 75 void scheduleCloseEvent();
75 76
76 CenteringMode m_centeringMode; 77 CenteringMode m_centeringMode;
77 LayoutUnit m_centeredPosition; 78 LayoutUnit m_centeredPosition;
78 String m_returnValue; 79 String m_returnValue;
79 }; 80 };
80 81
81 } // namespace blink 82 } // namespace blink
82 83
83 #endif // HTMLDialogElement_h 84 #endif // HTMLDialogElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/DialogShowParams.idl ('k') | third_party/WebKit/Source/core/html/HTMLDialogElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698