OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WindowFeaturesStructTraits_h |
| 6 #define WindowFeaturesStructTraits_h |
| 7 |
| 8 #include "../platform/WebStringMojoStringTraits.h" |
| 9 #include "../platform/WebVectorMojoArrayTraits.h" |
| 10 #include "WebWindowFeatures.h" |
| 11 #include "mojo/public/cpp/bindings/struct_traits.h" |
| 12 |
| 13 namespace mojo { |
| 14 |
| 15 template <typename MojomDataViewType> |
| 16 struct StructTraits<MojomDataViewType, ::blink::WebWindowFeatures> { |
| 17 static float x(const ::blink::WebWindowFeatures& features) { return features
.x; } |
| 18 static bool has_x(const ::blink::WebWindowFeatures& features) { return featu
res.xSet; } |
| 19 static float y(const ::blink::WebWindowFeatures& features) { return features
.y; } |
| 20 static bool has_y(const ::blink::WebWindowFeatures& features) { return featu
res.ySet; } |
| 21 static float width(const ::blink::WebWindowFeatures& features) { return feat
ures.width; } |
| 22 static bool has_width(const ::blink::WebWindowFeatures& features) { return f
eatures.widthSet; } |
| 23 static float height(const ::blink::WebWindowFeatures& features) { return fea
tures.height; } |
| 24 static bool has_height(const ::blink::WebWindowFeatures& features) { return
features.heightSet; } |
| 25 |
| 26 static bool menu_bar_visible(const ::blink::WebWindowFeatures& features) { r
eturn features.menuBarVisible; } |
| 27 static bool status_bar_visible(const ::blink::WebWindowFeatures& features) {
return features.statusBarVisible; } |
| 28 static bool tool_bar_visible(const ::blink::WebWindowFeatures& features) { r
eturn features.toolBarVisible; } |
| 29 static bool location_bar_visible(const ::blink::WebWindowFeatures& features)
{ return features.locationBarVisible; } |
| 30 static bool scrollbars_visible(const ::blink::WebWindowFeatures& features) {
return features.scrollbarsVisible; } |
| 31 static bool resizable(const ::blink::WebWindowFeatures& features) { return f
eatures.resizable; } |
| 32 |
| 33 static bool fullscreen(const ::blink::WebWindowFeatures& features) { return
features.fullscreen; } |
| 34 static bool dialog(const ::blink::WebWindowFeatures& features) { return feat
ures.dialog; } |
| 35 |
| 36 static const ::blink::WebVector<::blink::WebString>& additional_features( |
| 37 const ::blink::WebWindowFeatures& features) |
| 38 { |
| 39 return features.additionalFeatures; |
| 40 } |
| 41 |
| 42 static bool Read(MojomDataViewType data, ::blink::WebWindowFeatures* out) |
| 43 { |
| 44 out->x = data.x(); |
| 45 out->xSet = data.has_x(); |
| 46 out->y = data.y(); |
| 47 out->ySet = data.has_y(); |
| 48 out->width = data.width(); |
| 49 out->widthSet = data.has_width(); |
| 50 out->height = data.height(); |
| 51 out->heightSet = data.has_height(); |
| 52 out->menuBarVisible = data.menu_bar_visible(); |
| 53 out->statusBarVisible = data.status_bar_visible(); |
| 54 out->toolBarVisible = data.tool_bar_visible(); |
| 55 out->locationBarVisible = data.location_bar_visible(); |
| 56 out->scrollbarsVisible = data.scrollbars_visible(); |
| 57 out->resizable = data.resizable(); |
| 58 out->fullscreen = data.fullscreen(); |
| 59 out->dialog = data.dialog(); |
| 60 return data.ReadAdditionalFeatures(&out->additionalFeatures); |
| 61 } |
| 62 }; |
| 63 |
| 64 } // namespace mojo |
| 65 |
| 66 #endif |
OLD | NEW |