chromium/components/user_education/common/tutorial.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/user_education/common/tutorial.h"

#include <optional>

#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "components/strings/grit/components_strings.h"
#include "components/user_education/common/help_bubble.h"
#include "components/user_education/common/help_bubble_factory.h"
#include "components/user_education/common/help_bubble_factory_registry.h"
#include "components/user_education/common/help_bubble_params.h"
#include "components/user_education/common/tutorial_description.h"
#include "components/user_education/common/tutorial_service.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/interaction/element_tracker.h"
#include "ui/base/interaction/interaction_sequence.h"
#include "ui/base/l10n/l10n_util.h"

namespace user_education {

namespace {

int CountProgress(const std::vector<TutorialDescription::Step>& steps) {}

void CommonStepBuilderSetup(ui::InteractionSequence::StepBuilder& builder,
                            const TutorialDescription::Step& step) {}

// Adds a branch of a conditional to `builder` based on `condition` and `steps`.
void AddStepBuilderSubsequence(
    ui::InteractionSequence::StepBuilder& builder,
    ui::InteractionSequence::SubsequenceCondition condition,
    const std::vector<TutorialDescription::Step>& steps,
    int max_progress,
    int& current_progress,
    bool is_terminal,
    bool can_be_restarted,
    int complete_button_text_id,
    TutorialService* tutorial_service) {}

}  // namespace

namespace internal {

// Step Builder provides an interface for constructing an
// InteractionSequence::Step from a TutorialDescription::Step.
// TutorialDescription is used as the basis for the TutorialStepBuilder since
// all parameters of the Description will be needed to create the bubble or
// build the interaction sequence step. In order to use the The
// TutorialStepBuilder should only be used by Tutorial::Builder to construct the
// steps in the tutorial.
class TutorialStepBuilder {};

std::unique_ptr<ui::InteractionSequence::Step> TutorialStepBuilder::Build(
    TutorialService* tutorial_service) {}

ui::InteractionSequence::StepStartCallback
TutorialStepBuilder::BuildStartCallback(TutorialService* tutorial_service) {}

ui::InteractionSequence::StepStartCallback
TutorialStepBuilder::BuildMaybeShowBubbleCallback(
    TutorialService* tutorial_service) {}

ui::InteractionSequence::StepEndCallback
TutorialStepBuilder::BuildHideBubbleCallback(
    TutorialService* tutorial_service) {}

}  // namespace internal

// static
std::unique_ptr<ui::InteractionSequence::Step>
Tutorial::Builder::BuildFromDescriptionStep(
    const TutorialDescription::Step& step,
    int max_progress,
    int& current_progress,
    bool is_terminal,
    bool can_be_restarted,
    int complete_button_text_id,
    TutorialService* tutorial_service) {}

Tutorial::Builder::Builder()
    :{}
Tutorial::Builder::~Builder() = default;

// static
std::unique_ptr<Tutorial> Tutorial::Builder::BuildFromDescription(
    const TutorialDescription& description,
    TutorialService* tutorial_service,
    ui::ElementContext context) {}

Tutorial::Builder& Tutorial::Builder::AddStep(
    std::unique_ptr<ui::InteractionSequence::Step> step) {}

Tutorial::Builder& Tutorial::Builder::SetAbortedCallback(
    ui::InteractionSequence::AbortedCallback callback) {}

Tutorial::Builder& Tutorial::Builder::SetCompletedCallback(
    ui::InteractionSequence::CompletedCallback callback) {}

Tutorial::Builder& Tutorial::Builder::SetContext(
    ui::ElementContext element_context) {}

std::unique_ptr<Tutorial> Tutorial::Builder::Build() {}

Tutorial::Tutorial(
    std::unique_ptr<ui::InteractionSequence> interaction_sequence)
    :{}
Tutorial::~Tutorial() = default;

void Tutorial::Start() {}

void Tutorial::Abort() {}

void Tutorial::SetState(std::unique_ptr<ScopedTutorialState> tutorial_state) {}

}  // namespace user_education