| Index: third_party/WebKit/public/web/WindowFeaturesStructTraits.h
|
| diff --git a/third_party/WebKit/public/web/WindowFeaturesStructTraits.h b/third_party/WebKit/public/web/WindowFeaturesStructTraits.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a82333becfdf6c06089676e7aca373ac0419daa0
|
| --- /dev/null
|
| +++ b/third_party/WebKit/public/web/WindowFeaturesStructTraits.h
|
| @@ -0,0 +1,66 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WindowFeaturesStructTraits_h
|
| +#define WindowFeaturesStructTraits_h
|
| +
|
| +#include "../platform/WebStringMojoStringTraits.h"
|
| +#include "../platform/WebVectorMojoArrayTraits.h"
|
| +#include "WebWindowFeatures.h"
|
| +#include "mojo/public/cpp/bindings/struct_traits.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <typename MojomDataViewType>
|
| +struct StructTraits<MojomDataViewType, ::blink::WebWindowFeatures> {
|
| + static float x(const ::blink::WebWindowFeatures& features) { return features.x; }
|
| + static bool has_x(const ::blink::WebWindowFeatures& features) { return features.xSet; }
|
| + static float y(const ::blink::WebWindowFeatures& features) { return features.y; }
|
| + static bool has_y(const ::blink::WebWindowFeatures& features) { return features.ySet; }
|
| + static float width(const ::blink::WebWindowFeatures& features) { return features.width; }
|
| + static bool has_width(const ::blink::WebWindowFeatures& features) { return features.widthSet; }
|
| + static float height(const ::blink::WebWindowFeatures& features) { return features.height; }
|
| + static bool has_height(const ::blink::WebWindowFeatures& features) { return features.heightSet; }
|
| +
|
| + static bool menu_bar_visible(const ::blink::WebWindowFeatures& features) { return features.menuBarVisible; }
|
| + static bool status_bar_visible(const ::blink::WebWindowFeatures& features) { return features.statusBarVisible; }
|
| + static bool tool_bar_visible(const ::blink::WebWindowFeatures& features) { return features.toolBarVisible; }
|
| + static bool location_bar_visible(const ::blink::WebWindowFeatures& features) { return features.locationBarVisible; }
|
| + static bool scrollbars_visible(const ::blink::WebWindowFeatures& features) { return features.scrollbarsVisible; }
|
| + static bool resizable(const ::blink::WebWindowFeatures& features) { return features.resizable; }
|
| +
|
| + static bool fullscreen(const ::blink::WebWindowFeatures& features) { return features.fullscreen; }
|
| + static bool dialog(const ::blink::WebWindowFeatures& features) { return features.dialog; }
|
| +
|
| + static const ::blink::WebVector<::blink::WebString>& additional_features(
|
| + const ::blink::WebWindowFeatures& features)
|
| + {
|
| + return features.additionalFeatures;
|
| + }
|
| +
|
| + static bool Read(MojomDataViewType data, ::blink::WebWindowFeatures* out)
|
| + {
|
| + out->x = data.x();
|
| + out->xSet = data.has_x();
|
| + out->y = data.y();
|
| + out->ySet = data.has_y();
|
| + out->width = data.width();
|
| + out->widthSet = data.has_width();
|
| + out->height = data.height();
|
| + out->heightSet = data.has_height();
|
| + out->menuBarVisible = data.menu_bar_visible();
|
| + out->statusBarVisible = data.status_bar_visible();
|
| + out->toolBarVisible = data.tool_bar_visible();
|
| + out->locationBarVisible = data.location_bar_visible();
|
| + out->scrollbarsVisible = data.scrollbars_visible();
|
| + out->resizable = data.resizable();
|
| + out->fullscreen = data.fullscreen();
|
| + out->dialog = data.dialog();
|
| + return data.ReadAdditionalFeatures(&out->additionalFeatures);
|
| + }
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif
|
|
|