Flutter Engine
The Flutter Engine
view_ref_focused.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_FAKES_VIEW_REF_FOCUSED_H_
6#define FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_FAKES_VIEW_REF_FOCUSED_H_
7
8#include <fuchsia/ui/views/cpp/fidl.h>
9
11
13
15 public:
16 using WatchCallback = ViewRefFocused::WatchCallback;
17 std::size_t times_watched = 0;
18
19 void Watch(WatchCallback callback) override {
20 callback_ = std::move(callback);
22 }
23
24 void ScheduleCallback(bool focused) {
25 fuchsia::ui::views::FocusState focus_state;
26 focus_state.set_focused(focused);
27 callback_(std::move(focus_state));
28 }
29
30 private:
31 WatchCallback callback_;
32};
33
34} // namespace flutter_runner::testing
35
36#endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_FLUTTER_TESTS_FAKES_VIEW_REF_FOCUSED_H_
void Watch(WatchCallback callback) override
ViewRefFocused::WatchCallback WatchCallback
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
fuchsia::ui::views::ViewRefFocused ViewRefFocused