summaryrefslogtreecommitdiff
path: root/chromium/content/common/frame_owner_properties.h
blob: 2ead2790a570214ec087a35bd7fbbe0a604f9f83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// 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 CONTENT_COMMON_FRAME_OWNER_PROPERTIES_H_
#define CONTENT_COMMON_FRAME_OWNER_PROPERTIES_H_

#include <vector>

#include "content/common/content_export.h"
#include "third_party/WebKit/public/platform/modules/permissions/WebPermissionType.h"
#include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"

namespace content {

// Used for IPC transport of WebFrameOwnerProperties. WebFrameOwnerProperties
// can't be used directly as it contains a WebVector which doesn't have
// ParamTraits defined.
struct CONTENT_EXPORT FrameOwnerProperties {
  FrameOwnerProperties();
  FrameOwnerProperties(const FrameOwnerProperties& other);
  explicit FrameOwnerProperties(
      const blink::WebFrameOwnerProperties& web_frame_owner_properties);
  ~FrameOwnerProperties();

  blink::WebFrameOwnerProperties ToWebFrameOwnerProperties() const;

  bool operator==(const FrameOwnerProperties& other) const;
  bool operator!=(const FrameOwnerProperties& other) const {
    return !(*this == other);
  }

  blink::WebFrameOwnerProperties::ScrollingMode scrolling_mode;
  int margin_width;
  int margin_height;
  bool allow_fullscreen;
  bool allow_payment_request;

  // An experimental attribute to be used by a parent frame to enforce CSP on a
  // subframe. This is different from replicated CSP headers kept in
  // FrameReplicationState that keep track of CSP headers currently in effect
  // for a frame. See https://crbug.com/647588 and
  // https://www.w3.org/TR/csp-embedded-enforcement/#required-csp
  std::string required_csp;

  std::vector<blink::WebPermissionType> delegated_permissions;
};

}  // namespace content

#endif  // CONTENT_COMMON_FRAME_OWNER_PROPERTIES_H_