Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 13 matching lines...) Expand all Loading... | |
| 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 WebWindowFeatures_h | 31 #ifndef WebWindowFeatures_h |
| 32 #define WebWindowFeatures_h | 32 #define WebWindowFeatures_h |
| 33 | 33 |
| 34 #include "public/platform/WebCommon.h" | |
| 35 #include "public/platform/WebString.h" | |
| 36 #include "public/platform/WebVector.h" | |
| 37 | |
| 38 #if BLINK_IMPLEMENTATION | |
| 39 #include "core/page/WindowFeatures.h" | |
| 40 #endif | |
| 41 | |
| 42 namespace blink { | 34 namespace blink { |
| 43 | 35 |
| 44 struct WebWindowFeatures { | 36 struct WebWindowFeatures { |
| 45 float x; | 37 float x = 0; |
| 46 bool x_set; | 38 bool x_set = false; |
| 47 float y; | 39 float y = 0; |
| 48 bool y_set; | 40 bool y_set = false; |
| 49 float width; | 41 float width = 0; |
| 50 bool width_set; | 42 bool width_set = false; |
| 51 float height; | 43 float height = 0; |
| 52 bool height_set; | 44 bool height_set = false; |
| 53 | 45 |
| 54 bool menu_bar_visible; | 46 bool menu_bar_visible = true; |
| 55 bool status_bar_visible; | 47 bool status_bar_visible = true; |
| 56 bool tool_bar_visible; | 48 // This can be set based on "locationbar" or "toolbar" in a window features |
| 57 bool location_bar_visible; | 49 // string, we don't distinguish between the two. |
| 58 bool scrollbars_visible; | 50 bool tool_bar_visible = true; |
| 59 bool resizable; | 51 bool scrollbars_visible = true; |
| 60 | 52 |
| 61 bool fullscreen; | 53 bool noopener = false; |
| 62 bool dialog; | 54 bool background = false; |
|
dcheng
2017/06/02 18:46:22
From a layering perspective, I think it might be b
| |
| 63 WebVector<WebString> additional_features; | 55 bool persistent = false; |
| 64 | |
| 65 WebWindowFeatures() | |
| 66 : x(0), | |
| 67 x_set(false), | |
| 68 y(0), | |
| 69 y_set(false), | |
| 70 width(0), | |
| 71 width_set(false), | |
| 72 height(0), | |
| 73 height_set(false), | |
| 74 menu_bar_visible(true), | |
| 75 status_bar_visible(true), | |
| 76 tool_bar_visible(true), | |
| 77 location_bar_visible(true), | |
| 78 scrollbars_visible(true), | |
| 79 resizable(true), | |
| 80 fullscreen(false), | |
| 81 dialog(false) {} | |
| 82 | |
| 83 #if BLINK_IMPLEMENTATION | |
| 84 WebWindowFeatures(const WindowFeatures& f) | |
| 85 : x(f.x), | |
| 86 x_set(f.x_set), | |
| 87 y(f.y), | |
| 88 y_set(f.y_set), | |
| 89 width(f.width), | |
| 90 width_set(f.width_set), | |
| 91 height(f.height), | |
| 92 height_set(f.height_set), | |
| 93 menu_bar_visible(f.menu_bar_visible), | |
| 94 status_bar_visible(f.status_bar_visible), | |
| 95 tool_bar_visible(f.tool_bar_visible), | |
| 96 location_bar_visible(f.location_bar_visible), | |
| 97 scrollbars_visible(f.scrollbars_visible), | |
| 98 resizable(f.resizable), | |
| 99 fullscreen(f.fullscreen), | |
| 100 dialog(f.dialog), | |
| 101 additional_features(f.additional_features) {} | |
| 102 | |
| 103 operator WindowFeatures() const { | |
| 104 WindowFeatures result; | |
| 105 result.x = x; | |
| 106 result.x_set = x_set; | |
| 107 result.y = y; | |
| 108 result.y_set = y_set; | |
| 109 result.width = width; | |
| 110 result.width_set = width_set; | |
| 111 result.height = height; | |
| 112 result.height_set = height_set; | |
| 113 result.menu_bar_visible = menu_bar_visible; | |
| 114 result.status_bar_visible = status_bar_visible; | |
| 115 result.tool_bar_visible = tool_bar_visible; | |
| 116 result.location_bar_visible = location_bar_visible; | |
| 117 result.scrollbars_visible = scrollbars_visible; | |
| 118 result.resizable = resizable; | |
| 119 result.fullscreen = fullscreen; | |
| 120 result.dialog = dialog; | |
| 121 for (size_t i = 0; i < additional_features.size(); ++i) | |
| 122 result.additional_features.push_back(additional_features[i]); | |
| 123 return result; | |
| 124 } | |
| 125 #endif | |
| 126 }; | 56 }; |
| 127 | 57 |
| 128 } // namespace blink | 58 } // namespace blink |
| 129 | 59 |
| 130 #endif | 60 #endif |
| OLD | NEW |