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

Unified Diff: content/common/frame_owner_properties.cc

Issue 2146803004: Create a content::FrameOwnerProperties struct for IPC transport of WebFrameOwnerProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Transport Created 4 years, 5 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
Index: content/common/frame_owner_properties.cc
diff --git a/content/common/frame_owner_properties.cc b/content/common/frame_owner_properties.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f0c3d8d8a3533374e22adbe3f9e43ed735a39d99
--- /dev/null
+++ b/content/common/frame_owner_properties.cc
@@ -0,0 +1,44 @@
+// 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.
+
+#include "content/common/frame_owner_properties.h"
+
+namespace content {
+
+FrameOwnerProperties::FrameOwnerProperties() {}
+
+FrameOwnerProperties::FrameOwnerProperties(const FrameOwnerProperties& other)
dcheng 2016/07/14 11:17:48 Nit: just default this: FrameOwnerProperties::Fra
raymes 2016/07/18 03:39:28 whoa cool!
+ : scrolling_mode(other.scrolling_mode),
+ margin_width(other.margin_width),
+ margin_height(other.margin_height),
+ allow_fullscreen(other.allow_fullscreen),
+ delegated_permissions(other.delegated_permissions) {}
+
+FrameOwnerProperties::FrameOwnerProperties(
+ const blink::WebFrameOwnerProperties& web_frame_owner_properties)
+ : scrolling_mode(web_frame_owner_properties.scrollingMode),
+ margin_width(web_frame_owner_properties.marginWidth),
+ margin_height(web_frame_owner_properties.marginHeight),
+ allow_fullscreen(web_frame_owner_properties.allowFullscreen),
+ delegated_permissions(
+ web_frame_owner_properties.delegatedPermissions.begin(),
+ web_frame_owner_properties.delegatedPermissions.end()) {}
+
+FrameOwnerProperties::~FrameOwnerProperties() {}
+
+blink::WebFrameOwnerProperties FrameOwnerProperties::ToWebFrameOwnerProperties()
+ const {
+ blink::WebFrameOwnerProperties result;
+
+ result.scrollingMode = scrolling_mode;
+ result.marginWidth = margin_width;
+ result.marginHeight = margin_height;
+ result.allowFullscreen = allow_fullscreen;
+ result.delegatedPermissions =
+ blink::WebVector<blink::WebPermissionType>(delegated_permissions);
+
+ return result;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698