OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2007, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2007, 2010 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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef WindowFeatures_h | 29 #ifndef WindowFeatures_h |
30 #define WindowFeatures_h | 30 #define WindowFeatures_h |
31 | 31 |
| 32 #include "core/CoreExport.h" |
32 #include "wtf/Allocator.h" | 33 #include "wtf/Allocator.h" |
33 #include "wtf/HashMap.h" | 34 #include "wtf/HashMap.h" |
34 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
35 | 36 |
36 namespace blink { | 37 namespace blink { |
37 | 38 |
38 class IntRect; | 39 class IntRect; |
39 | 40 |
40 struct WindowFeatures { | 41 struct CORE_EXPORT WindowFeatures { |
41 DISALLOW_NEW(); | 42 DISALLOW_NEW(); |
42 WindowFeatures() | 43 WindowFeatures() |
43 : x(0) | 44 : x(0) |
44 , xSet(false) | 45 , xSet(false) |
45 , y(0) | 46 , y(0) |
46 , ySet(false) | 47 , ySet(false) |
47 , width(0) | 48 , width(0) |
48 , widthSet(false) | 49 , widthSet(false) |
49 , height(0) | 50 , height(0) |
50 , heightSet(false) | 51 , heightSet(false) |
51 , menuBarVisible(true) | 52 , menuBarVisible(true) |
52 , statusBarVisible(true) | 53 , statusBarVisible(true) |
53 , toolBarVisible(true) | 54 , toolBarVisible(true) |
54 , locationBarVisible(true) | 55 , locationBarVisible(true) |
55 , scrollbarsVisible(true) | 56 , scrollbarsVisible(true) |
56 , resizable(true) | 57 , resizable(true) |
57 , fullscreen(false) | 58 , fullscreen(false) |
58 , dialog(false) | 59 , dialog(false) |
| 60 , noopener(false) |
59 { | 61 { |
60 } | 62 } |
61 explicit WindowFeatures(const String& windowFeaturesString); | 63 explicit WindowFeatures(const String& windowFeaturesString); |
62 WindowFeatures(const String& dialogFeaturesString, const IntRect& screenAvai
lableRect); | 64 WindowFeatures(const String& dialogFeaturesString, const IntRect& screenAvai
lableRect); |
63 | 65 |
64 int x; | 66 int x; |
65 bool xSet; | 67 bool xSet; |
66 int y; | 68 int y; |
67 bool ySet; | 69 bool ySet; |
68 int width; | 70 int width; |
69 bool widthSet; | 71 bool widthSet; |
70 int height; | 72 int height; |
71 bool heightSet; | 73 bool heightSet; |
72 | 74 |
73 bool menuBarVisible; | 75 bool menuBarVisible; |
74 bool statusBarVisible; | 76 bool statusBarVisible; |
75 bool toolBarVisible; | 77 bool toolBarVisible; |
76 bool locationBarVisible; | 78 bool locationBarVisible; |
77 bool scrollbarsVisible; | 79 bool scrollbarsVisible; |
78 bool resizable; | 80 bool resizable; |
79 | 81 |
80 bool fullscreen; | 82 bool fullscreen; |
81 bool dialog; | 83 bool dialog; |
82 | 84 |
| 85 bool noopener; |
| 86 |
83 Vector<String> additionalFeatures; | 87 Vector<String> additionalFeatures; |
84 | 88 |
85 private: | 89 private: |
86 using DialogFeaturesMap = HashMap<String, String>; | 90 using DialogFeaturesMap = HashMap<String, String>; |
87 static void parseDialogFeatures(const String&, HashMap<String, String>&); | 91 static void parseDialogFeatures(const String&, HashMap<String, String>&); |
88 static bool boolFeature(const DialogFeaturesMap&, const char* key, bool defa
ultValue = false); | 92 static bool boolFeature(const DialogFeaturesMap&, const char* key, bool defa
ultValue = false); |
89 static int intFeature(const DialogFeaturesMap&, const char* key, int min, in
t max, int defaultValue); | 93 static int intFeature(const DialogFeaturesMap&, const char* key, int min, in
t max, int defaultValue); |
90 void setWindowFeature(const String& keyString, const String& valueString); | 94 void setWindowFeature(const String& keyString, const String& valueString); |
91 }; | 95 }; |
92 | 96 |
93 } // namespace blink | 97 } // namespace blink |
94 | 98 |
95 #endif // WindowFeatures_h | 99 #endif // WindowFeatures_h |
OLD | NEW |