#ifndef ASH_QUICK_INSERT_VIEWS_QUICK_INSERT_FEATURE_TOUR_H_
#define ASH_QUICK_INSERT_VIEWS_QUICK_INSERT_FEATURE_TOUR_H_
#include "ash/ash_export.h"
#include "base/functional/callback_forward.h"
#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/views/widget/unique_widget_ptr.h"
#include "ui/wm/public/activation_change_observer.h"
class PrefRegistrySimple;
class PrefService;
namespace aura {
class Window;
}
namespace views {
class Widget;
class Button;
}
namespace wm {
class ActivationClient;
}
namespace ash {
class ASH_EXPORT QuickInsertFeatureTour : public wm::ActivationChangeObserver {
public:
enum class EditorStatus {
kEligible,
kNotEligible,
};
QuickInsertFeatureTour();
QuickInsertFeatureTour(const QuickInsertFeatureTour&) = delete;
QuickInsertFeatureTour& operator=(const QuickInsertFeatureTour&) = delete;
~QuickInsertFeatureTour() override;
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
static void DisableFeatureTourForTesting();
bool MaybeShowForFirstUse(PrefService* prefs,
EditorStatus editor_status,
base::RepeatingClosure learn_more_callback,
base::RepeatingClosure completion_callback);
void OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) override;
views::Widget* widget_for_testing();
const views::Button* learn_more_button_for_testing() const;
const views::Button* complete_button_for_testing() const;
std::u16string_view GetTitleTextForTesting() const;
std::u16string_view GetDescriptionForTesting() const;
private:
void SetOnWindowDeactivatedCallback(base::OnceClosure callback);
void RunOnWindowDeactivatedIfNeeded();
views::UniqueWidgetPtr widget_;
base::OnceClosure on_window_deactivated_callback_;
base::ScopedObservation<wm::ActivationClient, wm::ActivationChangeObserver>
obs_{this};
base::WeakPtrFactory<QuickInsertFeatureTour> weak_ptr_factory_{this};
};
}
#endif