| 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 16 matching lines...) Expand all Loading... |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef WindowFeatures_h | 29 #ifndef WindowFeatures_h |
| 30 #define WindowFeatures_h | 30 #define WindowFeatures_h |
| 31 | 31 |
| 32 #include "wtf/HashMap.h" | 32 #include "wtf/HashMap.h" |
| 33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class FloatRect; | 37 class IntRect; |
| 38 | 38 |
| 39 struct WindowFeatures { | 39 struct WindowFeatures { |
| 40 WindowFeatures() | 40 WindowFeatures() |
| 41 : x(0.0f) | 41 : x(0) |
| 42 , xSet(false) | 42 , xSet(false) |
| 43 , y(0.0f) | 43 , y(0) |
| 44 , ySet(false) | 44 , ySet(false) |
| 45 , width(0.0f) | 45 , width(0) |
| 46 , widthSet(false) | 46 , widthSet(false) |
| 47 , height(0.0f) | 47 , height(0) |
| 48 , heightSet(false) | 48 , heightSet(false) |
| 49 , menuBarVisible(true) | 49 , menuBarVisible(true) |
| 50 , statusBarVisible(true) | 50 , statusBarVisible(true) |
| 51 , toolBarVisible(true) | 51 , toolBarVisible(true) |
| 52 , locationBarVisible(true) | 52 , locationBarVisible(true) |
| 53 , scrollbarsVisible(true) | 53 , scrollbarsVisible(true) |
| 54 , resizable(true) | 54 , resizable(true) |
| 55 , fullscreen(false) | 55 , fullscreen(false) |
| 56 , dialog(false) | 56 , dialog(false) |
| 57 { | 57 { |
| 58 } | 58 } |
| 59 explicit WindowFeatures(const String& windowFeaturesString); | 59 explicit WindowFeatures(const String& windowFeaturesString); |
| 60 WindowFeatures(const String& dialogFeaturesString, const FloatRect& screenAv
ailableRect); | 60 WindowFeatures(const String& dialogFeaturesString, const IntRect& screenAvai
lableRect); |
| 61 | 61 |
| 62 float x; | 62 int x; |
| 63 bool xSet; | 63 bool xSet; |
| 64 float y; | 64 int y; |
| 65 bool ySet; | 65 bool ySet; |
| 66 float width; | 66 int width; |
| 67 bool widthSet; | 67 bool widthSet; |
| 68 float height; | 68 int height; |
| 69 bool heightSet; | 69 bool heightSet; |
| 70 | 70 |
| 71 bool menuBarVisible; | 71 bool menuBarVisible; |
| 72 bool statusBarVisible; | 72 bool statusBarVisible; |
| 73 bool toolBarVisible; | 73 bool toolBarVisible; |
| 74 bool locationBarVisible; | 74 bool locationBarVisible; |
| 75 bool scrollbarsVisible; | 75 bool scrollbarsVisible; |
| 76 bool resizable; | 76 bool resizable; |
| 77 | 77 |
| 78 bool fullscreen; | 78 bool fullscreen; |
| 79 bool dialog; | 79 bool dialog; |
| 80 | 80 |
| 81 Vector<String> additionalFeatures; | 81 Vector<String> additionalFeatures; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 using DialogFeaturesMap = HashMap<String, String>; | 84 using DialogFeaturesMap = HashMap<String, String>; |
| 85 static void parseDialogFeatures(const String&, HashMap<String, String>&); | 85 static void parseDialogFeatures(const String&, HashMap<String, String>&); |
| 86 static bool boolFeature(const DialogFeaturesMap&, const char* key, bool defa
ultValue = false); | 86 static bool boolFeature(const DialogFeaturesMap&, const char* key, bool defa
ultValue = false); |
| 87 static float floatFeature(const DialogFeaturesMap&, const char* key, float m
in, float max, float defaultValue); | 87 static int intFeature(const DialogFeaturesMap&, const char* key, int min, in
t max, int defaultValue); |
| 88 void setWindowFeature(const String& keyString, const String& valueString); | 88 void setWindowFeature(const String& keyString, const String& valueString); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif // WindowFeatures_h | 93 #endif // WindowFeatures_h |
| OLD | NEW |