flutter_flutter/lib/ui/semantics/semantics_node.cc
Chris Yang fd7d7fa5a0
Add a11y support for embedded iOS platform view (#8156)
Follow up the framework change in flutter/flutter#29304.
Inject the accessibility element tree in the semantic node if the node is for platform views.

flutter/flutter#29302
2019-03-26 16:04:42 -07:00

32 lines
800 B
C++

// Copyright 2013 The Flutter 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 "flutter/lib/ui/semantics/semantics_node.h"
#include <string.h>
namespace blink {
constexpr int32_t kMinPlatfromViewId = -1;
SemanticsNode::SemanticsNode() = default;
SemanticsNode::SemanticsNode(const SemanticsNode& other) = default;
SemanticsNode::~SemanticsNode() = default;
bool SemanticsNode::HasAction(SemanticsAction action) {
return (actions & static_cast<int32_t>(action)) != 0;
}
bool SemanticsNode::HasFlag(SemanticsFlags flag) {
return (flags & static_cast<int32_t>(flag)) != 0;
}
bool SemanticsNode::IsPlatformViewNode() const {
return platformViewId > kMinPlatfromViewId;
}
} // namespace blink