#include "base/containers/map_util.h"
#include "base/notreached.h"
#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <list>
#include <memory>
#include <optional>
#include <string_view>
#include <utility>
#include <variant>
#include <vector>
#include "base/callback_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_forward.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_auto_reset.h"
#include "base/memory/weak_ptr.h"
#include "base/not_fatal_until.h"
#include "base/observer_list_internal.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/interaction/element_tracker.h"
#include "ui/base/interaction/interaction_sequence.h"
namespace ui {
namespace {
template <typename Signature, typename... Args>
void RunIfValid(base::OnceCallback<Signature> callback, Args... args) { … }
template <typename Arg, typename Ret, typename... Args>
base::OnceCallback<Ret(Arg, Args...)> PushUnusedArg(
base::OnceCallback<Ret(Args...)> callback) { … }
template <typename Arg1, typename Arg2, typename Ret, typename... Args>
base::OnceCallback<Ret(Arg1, Arg2, Args...)> PushUnusedArgs2(
base::OnceCallback<Ret(Args...)> callback) { … }
void SetDefaultMustRemainVisibleValue(InteractionSequence::Step* step,
const InteractionSequence::Step* next) { … }
bool AllowNullElementInStartCallback(InteractionSequence::StepType step_type) { … }
}
InteractionSequence::AbortedData::AbortedData() = default;
InteractionSequence::AbortedData::~AbortedData() = default;
InteractionSequence::AbortedData::AbortedData(const AbortedData&) = default;
InteractionSequence::AbortedData& InteractionSequence::AbortedData::operator=(
const AbortedData&) = default;
struct InteractionSequence::SubsequenceData { … };
InteractionSequence::Step::Step() = default;
InteractionSequence::Step::~Step() = default;
struct InteractionSequence::Configuration { … };
InteractionSequence::Builder::Builder()
: … { … }
InteractionSequence::Builder::Builder(Builder&& other) = default;
InteractionSequence::Builder& InteractionSequence::Builder::operator=(
Builder&& other) = default;
InteractionSequence::Builder::~Builder() = default;
InteractionSequence::Builder& InteractionSequence::Builder::SetAbortedCallback(
AbortedCallback callback) { … }
InteractionSequence::Builder&
InteractionSequence::Builder::SetCompletedCallback(CompletedCallback callback) { … }
InteractionSequence::Builder& InteractionSequence::Builder::AddStep(
std::unique_ptr<Step> step) { … }
InteractionSequence::Builder& InteractionSequence::Builder::AddStep(
StepBuilder& step_builder) { … }
InteractionSequence::Builder& InteractionSequence::Builder::AddStep(
StepBuilder&& step_builder) { … }
InteractionSequence::Builder& InteractionSequence::Builder::SetContext(
ElementContext context) { … }
InteractionSequence::Builder&
InteractionSequence::Builder::SetDefaultStepStartMode(
StepStartMode step_start_mode) { … }
std::unique_ptr<InteractionSequence> InteractionSequence::Builder::Build() { … }
std::unique_ptr<InteractionSequence>
InteractionSequence::Builder::BuildSubsequence(
const Configuration* reference_config,
const Step* reference_step) { … }
InteractionSequence::StepBuilder::StepBuilder()
: … { … }
InteractionSequence::StepBuilder::StepBuilder(StepBuilder&& other) = default;
InteractionSequence::StepBuilder& InteractionSequence::StepBuilder::operator=(
StepBuilder&& other) = default;
InteractionSequence::StepBuilder::~StepBuilder() = default;
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetElementID(ElementIdentifier element_id) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetElementName(std::string_view name) { … }
InteractionSequence::StepBuilder& InteractionSequence::StepBuilder::SetContext(
StepContext context) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetMustBeVisibleAtStart(
bool must_be_visible) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetMustRemainVisible(
bool must_remain_visible) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetTransitionOnlyOnEvent(
bool transition_only_on_event) { … }
InteractionSequence::StepBuilder& InteractionSequence::StepBuilder::SetType(
StepType step_type,
CustomElementEventType event_type) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetSubsequenceMode(
SubsequenceMode subsequence_mode) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::AddSubsequence(
Builder subsequence,
SubsequenceCondition condition) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetStartCallback(
StepStartCallback start_callback) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetStartCallback(
base::OnceCallback<void(TrackedElement*)> start_callback) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetStartCallback(
base::OnceClosure start_callback) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetStepStartMode(
StepStartMode step_start_mode) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetEndCallback(StepEndCallback end_callback) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetEndCallback(
base::OnceClosure end_callback) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::SetDescription(std::string_view description) { … }
InteractionSequence::StepBuilder&
InteractionSequence::StepBuilder::FormatDescription(
std::string_view format_string) { … }
std::unique_ptr<InteractionSequence::Step>
InteractionSequence::StepBuilder::Build() { … }
InteractionSequence::InteractionSequence(
std::unique_ptr<Configuration> configuration,
const Step* reference_step)
: … { … }
InteractionSequence::SubsequenceCondition InteractionSequence::AlwaysRun() { … }
std::unique_ptr<InteractionSequence::Step>
InteractionSequence::WithInitialElement(TrackedElement* element,
StepStartCallback start_callback,
StepEndCallback end_callback) { … }
InteractionSequence::~InteractionSequence() { … }
void InteractionSequence::Start() { … }
void InteractionSequence::RunSynchronouslyForTesting() { … }
bool InteractionSequence::IsCurrentStepInAnyContextForTesting() const { … }
void InteractionSequence::FailForTesting() { … }
void InteractionSequence::NameElement(TrackedElement* element,
std::string_view name) { … }
TrackedElement* InteractionSequence::GetNamedElement(const std::string& name) { … }
const TrackedElement* InteractionSequence::GetNamedElement(
const std::string& name) const { … }
InteractionSequence::AbortedData InteractionSequence::BuildAbortedData(
AbortedReason reason) const { … }
base::WeakPtr<InteractionSequence> InteractionSequence::AsWeakPtr() { … }
void InteractionSequence::OnElementShown(TrackedElement* element) { … }
void InteractionSequence::OnElementActivated(TrackedElement* element) { … }
void InteractionSequence::OnCustomEvent(TrackedElement* element) { … }
void InteractionSequence::OnElementHidden(TrackedElement* element) { … }
void InteractionSequence::OnTriggerDuringStepTransition(
TrackedElement* element) { … }
void InteractionSequence::OnElementHiddenDuringStepTransition(
TrackedElement* element) { … }
void InteractionSequence::OnElementHiddenWaitingForEvent(
TrackedElement* element) { … }
void InteractionSequence::MaybeWatchForEarlyTrigger(const Step* current_step) { … }
void InteractionSequence::StartStepTransition(TrackedElement* element) { … }
void InteractionSequence::CompleteStepTransition() { … }
void InteractionSequence::StageNextStep() { … }
void InteractionSequence::Abort(AbortedReason reason) { … }
bool InteractionSequence::MatchesNameIfSpecified(
const TrackedElement* element,
const std::string& name) const { … }
ElementContext InteractionSequence::UpdateNextStepContext(
const Step* current_step) { … }
InteractionSequence::SubsequenceData* InteractionSequence::FindSubsequenceData(
SubsequenceHandle subsequence) { … }
void InteractionSequence::OnSubsequenceCompleted(
SubsequenceHandle subsequence) { … }
void InteractionSequence::OnSubsequenceAborted(
SubsequenceHandle subsequence,
const AbortedData& aborted_data) { … }
void InteractionSequence::BuildSubsequences(const Step* current_step) { … }
InteractionSequence::Step* InteractionSequence::next_step() { … }
const InteractionSequence::Step* InteractionSequence::next_step() const { … }
ElementContext InteractionSequence::context() const { … }
void PrintTo(InteractionSequence::StepType step_type, std::ostream* os) { … }
void PrintTo(InteractionSequence::AbortedReason reason, std::ostream* os) { … }
void PrintTo(InteractionSequence::SubsequenceMode mode, std::ostream* os) { … }
void PrintTo(InteractionSequence::StepStartMode mode, std::ostream* os) { … }
void PrintTo(const InteractionSequence::AbortedData& data, std::ostream* os) { … }
extern std::ostream& operator<<(std::ostream& os,
InteractionSequence::StepType step_type) { … }
extern std::ostream& operator<<(std::ostream& os,
InteractionSequence::AbortedReason reason) { … }
extern std::ostream& operator<<(std::ostream& os,
InteractionSequence::StepStartMode mode) { … }
extern std::ostream& operator<<(std::ostream& os,
InteractionSequence::SubsequenceMode mode) { … }
extern std::ostream& operator<<(std::ostream& os,
const InteractionSequence::AbortedData& data) { … }
}