Commit 4898ea48 authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

[Fuchsia] Add support for selectively enabling input types.

* Implements the FIDL ConfigureInputTypes() API, for embedder control
over whether input events should be routed to web content or ignored.
* Transitions CastRunner to use ConfigureInputTypes().
* Removes the deprecated SetInputEnabled() method.

Bug: 1031776
Change-Id: I54e0b5c3b5a92935e6860e037edc6bc5a92eaa42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1956154
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755219}
parent 634b745e
......@@ -128,8 +128,8 @@ component("web_engine_core") {
"browser/context_impl.h",
"browser/cookie_manager_impl.cc",
"browser/cookie_manager_impl.h",
"browser/discarding_event_filter.cc",
"browser/discarding_event_filter.h",
"browser/event_filter.cc",
"browser/event_filter.h",
"browser/frame_impl.cc",
"browser/frame_impl.h",
"browser/frame_layout_manager.cc",
......@@ -276,6 +276,7 @@ test("web_engine_unittests") {
sources = [
"browser/ax_tree_converter_unittest.cc",
"browser/cookie_manager_impl_unittest.cc",
"browser/event_filter_unittest.cc",
"browser/frame_impl_unittest.cc",
"browser/url_request_rewrite_rules_manager_unittest.cc",
"common/web_engine_url_loader_throttle_unittest.cc",
......
// Copyright 2019 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 "fuchsia/engine/browser/discarding_event_filter.h"
DiscardingEventFilter::DiscardingEventFilter() = default;
DiscardingEventFilter::~DiscardingEventFilter() = default;
ui::EventDispatchDetails DiscardingEventFilter::RewriteEvent(
const ui::Event& event,
const Continuation continuation) {
if (discard_events_)
return DiscardEvent(continuation);
return SendEvent(continuation, &event);
}
// Copyright 2019 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 FUCHSIA_ENGINE_BROWSER_DISCARDING_EVENT_FILTER_H_
#define FUCHSIA_ENGINE_BROWSER_DISCARDING_EVENT_FILTER_H_
#include <memory>
#include "base/macros.h"
#include "ui/events/event_rewriter.h"
// Event filter which will drop incoming events when |discard_events_| is set.
class DiscardingEventFilter : public ui::EventRewriter {
public:
DiscardingEventFilter();
~DiscardingEventFilter() override;
void set_discard_events(bool discard_events) {
discard_events_ = discard_events;
}
private:
// ui::EventRewriter overrides.
ui::EventDispatchDetails RewriteEvent(
const ui::Event& event,
const Continuation continuation) override;
// When set, all incoming events will be discarded before they are
// delivered to their sink.
bool discard_events_ = false;
DISALLOW_COPY_AND_ASSIGN(DiscardingEventFilter);
};
#endif // FUCHSIA_ENGINE_BROWSER_DISCARDING_EVENT_FILTER_H_
// Copyright 2019 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 "fuchsia/engine/browser/event_filter.h"
#include <limits>
#include "ui/events/event.h"
namespace {
using fuchsia::web::InputTypes;
const uint64_t kInputTypeNone = 0;
const uint64_t kInputTypeAll = std::numeric_limits<uint64_t>::max();
static_assert(
std::is_same<uint64_t,
std::underlying_type<fuchsia::web::InputTypes>::type>::value,
"InputTypes is not an uint64.");
} // namespace
EventFilter::EventFilter() {
// Allow all inputs by default.
ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::ALLOW);
}
EventFilter::~EventFilter() = default;
void EventFilter::ConfigureInputTypes(fuchsia::web::InputTypes types,
fuchsia::web::AllowInputState allow) {
// If |types| contains ALL, all other type bits are superseded.
if (allow == fuchsia::web::AllowInputState::ALLOW) {
if (static_cast<uint64_t>(types) &
static_cast<uint64_t>(fuchsia::web::InputTypes::ALL)) {
enabled_input_types_ = kInputTypeAll;
enable_unknown_types_ = true;
} else {
enabled_input_types_ |= static_cast<uint64_t>(types);
}
} else {
if (static_cast<uint64_t>(types) &
static_cast<uint64_t>(fuchsia::web::InputTypes::ALL)) {
enabled_input_types_ = kInputTypeNone;
enable_unknown_types_ = false;
} else {
enabled_input_types_ &= static_cast<uint64_t>(~types);
}
}
}
void EventFilter::OnEvent(ui::Event* event) {
if (!IsEventAllowed(event->type())) {
event->StopPropagation();
return;
}
// Allow base class to route |event| to event type-specific handlers.
ui::EventHandler::OnEvent(event);
}
void EventFilter::OnGestureEvent(ui::GestureEvent* event) {
if (!IsEventAllowed(event->type())) {
event->StopPropagation();
return;
}
ui::EventHandler::OnGestureEvent(event);
}
bool EventFilter::IsEventAllowed(ui::EventType type) {
switch (type) {
case ui::ET_KEY_PRESSED:
case ui::ET_KEY_RELEASED:
return IsTypeEnabled(InputTypes::KEY);
case ui::ET_MOUSE_PRESSED:
case ui::ET_MOUSE_DRAGGED:
case ui::ET_MOUSE_RELEASED:
return IsTypeEnabled(InputTypes::MOUSE_CLICK);
case ui::ET_MOUSE_MOVED:
case ui::ET_MOUSE_ENTERED:
case ui::ET_MOUSE_EXITED:
return IsTypeEnabled(InputTypes::MOUSE_MOVE);
case ui::ET_MOUSEWHEEL:
return IsTypeEnabled(InputTypes::MOUSE_WHEEL);
case ui::ET_GESTURE_TAP:
case ui::ET_GESTURE_TAP_DOWN:
case ui::ET_GESTURE_TAP_CANCEL:
case ui::ET_GESTURE_TAP_UNCONFIRMED:
case ui::ET_GESTURE_DOUBLE_TAP:
case ui::ET_GESTURE_TWO_FINGER_TAP:
case ui::ET_GESTURE_LONG_PRESS:
case ui::ET_GESTURE_LONG_TAP:
return IsTypeEnabled(InputTypes::GESTURE_TAP);
case ui::ET_GESTURE_PINCH_BEGIN:
case ui::ET_GESTURE_PINCH_END:
case ui::ET_GESTURE_PINCH_UPDATE:
return IsTypeEnabled(InputTypes::GESTURE_PINCH);
case ui::ET_GESTURE_SCROLL_BEGIN:
case ui::ET_GESTURE_SCROLL_END:
case ui::ET_GESTURE_SCROLL_UPDATE:
case ui::ET_GESTURE_SWIPE:
case ui::ET_SCROLL:
case ui::ET_SCROLL_FLING_START:
case ui::ET_SCROLL_FLING_CANCEL:
return IsTypeEnabled(InputTypes::GESTURE_DRAG);
// Allow low-level touch events and non-input control messages to pass
// through unimpeded.
case ui::ET_TOUCH_RELEASED:
case ui::ET_TOUCH_PRESSED:
case ui::ET_TOUCH_MOVED:
case ui::ET_TOUCH_CANCELLED:
case ui::ET_DROP_TARGET_EVENT:
case ui::ET_GESTURE_SHOW_PRESS:
case ui::ET_GESTURE_BEGIN:
case ui::ET_GESTURE_END:
case ui::ET_CANCEL_MODE:
case ui::ET_MOUSE_CAPTURE_CHANGED:
return true;
case ui::ET_UMA_DATA:
NOTREACHED(); // ChromeOS only.
break;
case ui::ET_LAST:
NOTREACHED();
FALLTHROUGH;
case ui::ET_UNKNOWN:
break;
}
return enable_unknown_types_;
}
bool EventFilter::IsTypeEnabled(InputTypes type) const {
return (enabled_input_types_ & static_cast<uint64_t>(type));
}
// Copyright 2019 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 FUCHSIA_ENGINE_BROWSER_EVENT_FILTER_H_
#define FUCHSIA_ENGINE_BROWSER_EVENT_FILTER_H_
#include <fuchsia/web/cpp/fidl.h>
#include <memory>
#include "base/macros.h"
#include "ui/events/event_handler.h"
#include "ui/events/types/event_type.h"
// Event filter which can be configured to drop all events, or certain kinds of
// events.
class EventFilter : public ui::EventHandler {
public:
EventFilter();
~EventFilter() override;
EventFilter(const EventFilter&) = delete;
EventFilter& operator=(const EventFilter&) = delete;
void ConfigureInputTypes(fuchsia::web::InputTypes types,
fuchsia::web::AllowInputState allow);
private:
friend class EventFilterTest;
bool IsEventAllowed(ui::EventType type);
// Returns whether |type| is set in the |enabled_input_types_| bitmask.
bool IsTypeEnabled(fuchsia::web::InputTypes type) const;
// ui::EventRewriter implementation.
void OnEvent(ui::Event* event) final;
void OnGestureEvent(ui::GestureEvent* event) final;
uint64_t enabled_input_types_ = 0;
// Allows input events not mapped to fuchsia::web::InputTypes entries
// to be processed. Set by allowing or denying fuchsia::web::InputTypes::ALL.
bool enable_unknown_types_ = true;
};
#endif // FUCHSIA_ENGINE_BROWSER_EVENT_FILTER_H_
// Copyright 2020 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 <fuchsia/web/cpp/fidl.h>
#include "fuchsia/engine/browser/event_filter.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event.h"
using fuchsia::web::InputTypes;
struct EventTypeMappingEntry {
ui::EventType ui_type;
fuchsia::web::InputTypes fuchsia_type;
};
constexpr EventTypeMappingEntry kEventTypeMappings[] = {
{ui::ET_MOUSE_PRESSED, InputTypes::MOUSE_CLICK},
{ui::ET_MOUSE_DRAGGED, InputTypes::MOUSE_CLICK},
{ui::ET_MOUSE_RELEASED, InputTypes::MOUSE_CLICK},
{ui::ET_MOUSE_MOVED, InputTypes::MOUSE_MOVE},
{ui::ET_MOUSE_ENTERED, InputTypes::MOUSE_MOVE},
{ui::ET_MOUSE_EXITED, InputTypes::MOUSE_MOVE},
{ui::ET_MOUSEWHEEL, InputTypes::MOUSE_WHEEL},
{ui::ET_GESTURE_TAP, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_TAP_DOWN, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_TAP_CANCEL, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_TAP_UNCONFIRMED, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_DOUBLE_TAP, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_TWO_FINGER_TAP, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_LONG_PRESS, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_LONG_TAP, InputTypes::GESTURE_TAP},
{ui::ET_GESTURE_PINCH_BEGIN, InputTypes::GESTURE_PINCH},
{ui::ET_GESTURE_PINCH_END, InputTypes::GESTURE_PINCH},
{ui::ET_GESTURE_PINCH_UPDATE, InputTypes::GESTURE_PINCH},
{ui::ET_GESTURE_SCROLL_BEGIN, InputTypes::GESTURE_DRAG},
{ui::ET_GESTURE_SCROLL_END, InputTypes::GESTURE_DRAG},
{ui::ET_GESTURE_SCROLL_UPDATE, InputTypes::GESTURE_DRAG},
{ui::ET_GESTURE_SWIPE, InputTypes::GESTURE_DRAG},
{ui::ET_SCROLL, InputTypes::GESTURE_DRAG},
{ui::ET_SCROLL_FLING_START, InputTypes::GESTURE_DRAG},
{ui::ET_SCROLL_FLING_CANCEL, InputTypes::GESTURE_DRAG},
{ui::ET_KEY_PRESSED, InputTypes::KEY},
{ui::ET_KEY_RELEASED, InputTypes::KEY},
};
constexpr ui::EventType kAlwaysAllowedEventTypes[] = {
ui::ET_TOUCH_RELEASED, ui::ET_TOUCH_PRESSED,
ui::ET_TOUCH_MOVED, ui::ET_TOUCH_CANCELLED,
ui::ET_DROP_TARGET_EVENT, ui::ET_GESTURE_SHOW_PRESS,
ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_END,
ui::ET_CANCEL_MODE, ui::ET_MOUSE_CAPTURE_CHANGED,
};
constexpr ui::EventType kUserEvent =
static_cast<ui::EventType>(ui::ET_LAST + 1);
class TestEvent : public ui::Event {
public:
explicit TestEvent(ui::EventType type)
: ui::Event(type, {} /* time_stamp */, 0 /* flags */) {}
~TestEvent() override = default;
};
class EventFilterTest : public testing::Test {
public:
EventFilterTest() = default;
~EventFilterTest() override = default;
protected:
void OnEvent(ui::Event* event) { event_filter_.OnEvent(event); }
EventFilter event_filter_;
};
TEST_F(EventFilterTest, AllowedByDefault) {
for (const auto& entry : kEventTypeMappings) {
TestEvent event(entry.ui_type);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_FALSE(event.stopped_propagation());
}
}
TEST_F(EventFilterTest, SelectivelyAllowed) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
for (const auto& entry : kEventTypeMappings) {
event_filter_.ConfigureInputTypes(entry.fuchsia_type,
fuchsia::web::AllowInputState::ALLOW);
TestEvent event(entry.ui_type);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_FALSE(event.stopped_propagation());
}
}
TEST_F(EventFilterTest, AllDenied) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
for (const auto& entry : kEventTypeMappings) {
TestEvent event(entry.ui_type);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_TRUE(event.stopped_propagation());
}
}
TEST_F(EventFilterTest, SelectivelyDenied) {
for (const auto& entry : kEventTypeMappings) {
event_filter_.ConfigureInputTypes(entry.fuchsia_type,
fuchsia::web::AllowInputState::DENY);
TestEvent event(entry.ui_type);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_TRUE(event.stopped_propagation());
}
}
TEST_F(EventFilterTest, AllowCombination) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
event_filter_.ConfigureInputTypes(
InputTypes::MOUSE_CLICK | InputTypes::MOUSE_WHEEL,
fuchsia::web::AllowInputState::ALLOW);
TestEvent event1(ui::ET_MOUSE_PRESSED);
ASSERT_FALSE(event1.stopped_propagation());
OnEvent(&event1);
EXPECT_FALSE(event1.stopped_propagation());
TestEvent event2(ui::ET_MOUSEWHEEL);
ASSERT_FALSE(event2.stopped_propagation());
OnEvent(&event2);
EXPECT_FALSE(event2.stopped_propagation());
// Events not explicitly re-enabled are still denied.
TestEvent dropped_event(ui::ET_KEY_PRESSED);
ASSERT_FALSE(dropped_event.stopped_propagation());
OnEvent(&dropped_event);
EXPECT_TRUE(dropped_event.stopped_propagation());
}
TEST_F(EventFilterTest, AllowUnknown) {
TestEvent event(kUserEvent);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_FALSE(event.stopped_propagation());
TestEvent event2(ui::ET_UNKNOWN);
ASSERT_FALSE(event2.stopped_propagation());
OnEvent(&event);
EXPECT_FALSE(event2.stopped_propagation());
}
TEST_F(EventFilterTest, DenyUnknown) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
TestEvent event(kUserEvent);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_TRUE(event.stopped_propagation());
TestEvent event2(ui::ET_UNKNOWN);
ASSERT_FALSE(event2.stopped_propagation());
OnEvent(&event2);
EXPECT_TRUE(event2.stopped_propagation());
}
TEST_F(EventFilterTest, AllowUnknown_AllowAllAfterDenyAll) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::ALLOW);
TestEvent event(kUserEvent);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_FALSE(event.stopped_propagation());
}
TEST_F(EventFilterTest, DenyUnknown_AllowSomeAfterDenyAll) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::MOUSE_CLICK,
fuchsia::web::AllowInputState::ALLOW);
TestEvent event(kUserEvent);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_TRUE(event.stopped_propagation());
}
TEST_F(EventFilterTest, LowLevelAndControlAlwaysAllowed) {
event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
for (ui::EventType type : kAlwaysAllowedEventTypes) {
TestEvent event(type);
ASSERT_FALSE(event.stopped_propagation());
OnEvent(&event);
EXPECT_FALSE(event.stopped_propagation());
}
}
......@@ -34,6 +34,7 @@
#include "fuchsia/base/message_port.h"
#include "fuchsia/engine/browser/accessibility_bridge.h"
#include "fuchsia/engine/browser/context_impl.h"
#include "fuchsia/engine/browser/event_filter.h"
#include "fuchsia/engine/browser/frame_layout_manager.h"
#include "fuchsia/engine/browser/web_engine_devtools_controller.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
......@@ -517,6 +518,7 @@ void FrameImpl::DestroyWindowTreeHost() {
aura::client::SetFocusClient(root_window(), nullptr);
wm::SetActivationClient(root_window(), nullptr);
root_window()->RemovePreTargetHandler(&event_filter_);
root_window()->RemovePreTargetHandler(focus_controller_.get());
web_contents_->GetNativeView()->Hide();
window_tree_host_->Hide();
......@@ -741,8 +743,9 @@ void FrameImpl::SetJavaScriptLogLevel(fuchsia::web::ConsoleLogLevel level) {
log_level_ = ConsoleLogLevelToLoggingSeverity(level);
}
void FrameImpl::SetEnableInput(bool enable_input) {
discarding_event_filter_.set_discard_events(!enable_input);
void FrameImpl::ConfigureInputTypes(fuchsia::web::InputTypes types,
fuchsia::web::AllowInputState allow) {
event_filter_.ConfigureInputTypes(types, allow);
}
void FrameImpl::SetPopupFrameCreationListener(
......@@ -804,9 +807,7 @@ void FrameImpl::SetWindowTreeHost(
window_tree_host_ = std::move(window_tree_host);
window_tree_host_->InitHost();
window_tree_host_->window()->GetHost()->AddEventRewriter(
&discarding_event_filter_);
root_window()->AddPreTargetHandler(&event_filter_);
// Add hooks which automatically set the focus state when input events are
// received.
......
......@@ -21,7 +21,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "fuchsia/engine/browser/accessibility_bridge.h"
#include "fuchsia/engine/browser/discarding_event_filter.h"
#include "fuchsia/engine/browser/event_filter.h"
#include "fuchsia/engine/browser/frame_permission_controller.h"
#include "fuchsia/engine/browser/navigation_controller_impl.h"
#include "fuchsia/engine/browser/url_request_rewrite_rules_manager.h"
......@@ -163,7 +163,8 @@ class FrameImpl : public fuchsia::web::Frame,
fidl::InterfaceHandle<fuchsia::web::NavigationEventListener> listener)
override;
void SetJavaScriptLogLevel(fuchsia::web::ConsoleLogLevel level) override;
void SetEnableInput(bool enable_input) override;
void ConfigureInputTypes(fuchsia::web::InputTypes types,
fuchsia::web::AllowInputState allow) override;
void SetPopupFrameCreationListener(
fidl::InterfaceHandle<fuchsia::web::PopupFrameCreationListener> listener)
override;
......@@ -226,7 +227,6 @@ class FrameImpl : public fuchsia::web::Frame,
std::unique_ptr<aura::WindowTreeHost> window_tree_host_;
std::unique_ptr<wm::FocusController> focus_controller_;
DiscardingEventFilter discarding_event_filter_;
// Owned via |window_tree_host_|.
FrameLayoutManager* layout_manager_ = nullptr;
......@@ -235,6 +235,7 @@ class FrameImpl : public fuchsia::web::Frame,
fuchsia::accessibility::semantics::SemanticsManagerPtr
semantics_manager_for_test_;
EventFilter event_filter_;
NavigationControllerImpl navigation_controller_;
logging::LogSeverity log_level_;
std::map<uint64_t, OriginScopedScript> before_load_scripts_;
......
......@@ -26,5 +26,8 @@ ApplicationControllerImpl::ApplicationControllerImpl(
ApplicationControllerImpl::~ApplicationControllerImpl() = default;
void ApplicationControllerImpl::SetTouchInputEnabled(bool enable) {
frame_->SetEnableInput(enable);
frame_->ConfigureInputTypes(fuchsia::web::InputTypes::GESTURE_TAP |
fuchsia::web::InputTypes::GESTURE_DRAG,
(enable ? fuchsia::web::AllowInputState::ALLOW
: fuchsia::web::AllowInputState::DENY));
}
......@@ -26,7 +26,9 @@ class MockFrame : public fuchsia::web::testing::Frame_TestBase {
LOG(FATAL) << "No mock defined for " << name;
}
MOCK_METHOD1(SetEnableInput, void(bool));
MOCK_METHOD2(ConfigureInputTypes,
void(fuchsia::web::InputTypes types,
fuchsia::web::AllowInputState allow));
};
class ApplicationControllerImplTest : public chromium::cast::ApplicationContext,
......@@ -71,11 +73,18 @@ class ApplicationControllerImplTest : public chromium::cast::ApplicationContext,
};
// Verifies that SetTouchInputEnabled() calls the Frame API correctly.
TEST_F(ApplicationControllerImplTest, SetEnableInput) {
TEST_F(ApplicationControllerImplTest, ConfigureInputTypes) {
base::RunLoop run_loop;
EXPECT_CALL(frame_, SetEnableInput(true)).Times(2);
EXPECT_CALL(frame_, SetEnableInput(false))
EXPECT_CALL(frame_,
ConfigureInputTypes(fuchsia::web::InputTypes::GESTURE_TAP |
fuchsia::web::InputTypes::GESTURE_DRAG,
fuchsia::web::AllowInputState::ALLOW))
.Times(2);
EXPECT_CALL(frame_,
ConfigureInputTypes(fuchsia::web::InputTypes::GESTURE_TAP |
fuchsia::web::InputTypes::GESTURE_DRAG,
fuchsia::web::AllowInputState::DENY))
.WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); }));
application_ptr_->SetTouchInputEnabled(true);
......
......@@ -69,7 +69,8 @@ void CastComponent::StartComponent() {
OnRewriteRulesReceived(std::move(initial_rewrite_rules_));
frame()->SetMediaSessionId(media_session_id_);
frame()->SetEnableInput(false);
frame()->ConfigureInputTypes(fuchsia::web::InputTypes::ALL,
fuchsia::web::AllowInputState::DENY);
frame()->SetNavigationEventListener(
navigation_listener_binding_.NewBinding());
api_bindings_client_->AttachToFrame(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment