Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: third_party/WebKit/public/web/WindowFeaturesStructTraits.h

Issue 2353003004: Move ViewHostMsg_CreateWindow to mojom (Closed)
Patch Set: . Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/public/web/OWNERS ('k') | third_party/WebKit/public/web/window_features.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/public/web/OWNERS ('k') | third_party/WebKit/public/web/window_features.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698