chromium/components/user_education/common/tutorial_service.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_service.h"

#include <memory>
#include <vector>

#include "base/auto_reset.h"
#include "base/callback_list.h"
#include "base/functional/bind.h"
#include "base/time/time.h"
#include "components/user_education/common/help_bubble.h"
#include "components/user_education/common/help_bubble_factory_registry.h"
#include "components/user_education/common/tutorial.h"
#include "components/user_education/common/tutorial_identifier.h"
#include "components/user_education/common/tutorial_registry.h"

namespace user_education {

namespace {
// How long a tutorial has to go without a bubble before we assume it's broken
// and abort it.
constexpr base::TimeDelta kBrokenTutorialTimeout =;
// How long a tutorial has to go before the first bubble is shown before we
// assume it's been broken or abandoned and abort it. This is longer than the
// above because we want to allow the user time to navigate to the surface that
// triggers the tutorial.
constexpr base::TimeDelta kTutorialNotStartedTimeout =;
}  // namespace

TutorialService::TutorialCreationParams::TutorialCreationParams(
    const TutorialDescription* description,
    ui::ElementContext context)
    :{}

TutorialService::TutorialService(
    TutorialRegistry* tutorial_registry,
    HelpBubbleFactoryRegistry* help_bubble_factory_registry)
    :{}

TutorialService::~TutorialService() = default;

void TutorialService::StartTutorial(TutorialIdentifier id,
                                    ui::ElementContext context,
                                    CompletedCallback completed_callback,
                                    AbortedCallback aborted_callback,
                                    RestartedCallback restarted_callback) {}

bool TutorialService::CancelTutorialIfRunning(
    std::optional<TutorialIdentifier> id) {}

void TutorialService::LogIPHLinkClicked(TutorialIdentifier id,
                                        bool iph_link_was_clicked) {}

void TutorialService::LogStartedFromWhatsNewPage(TutorialIdentifier id,
                                                 bool success) {}

bool TutorialService::RestartTutorial() {}

void TutorialService::AbortTutorial(std::optional<int> abort_step) {}

void TutorialService::OnNonFinalBubbleClosed(HelpBubble* bubble,
                                             HelpBubble::CloseReason) {}

void TutorialService::CompleteTutorial() {}

void TutorialService::SetCurrentBubble(std::unique_ptr<HelpBubble> bubble,
                                       bool is_last_step) {}

void TutorialService::HideCurrentBubbleIfShowing() {}

bool TutorialService::IsRunningTutorial(
    std::optional<TutorialIdentifier> id) const {}

void TutorialService::ResetRunningTutorial() {}

void TutorialService::OnBrokenTutorial() {}

}  // namespace user_education