1 // Copyright 2019 The Chromium 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 ASH_PUBLIC_CPP_ASSISTANT_ASSISTANT_SETUP_H_
6 #define ASH_PUBLIC_CPP_ASSISTANT_ASSISTANT_SETUP_H_
7 
8 #include "ash/public/cpp/ash_public_export.h"
9 #include "base/callback_forward.h"
10 #include "base/macros.h"
11 
12 namespace ash {
13 
14 enum class ASH_PUBLIC_EXPORT FlowType {
15   // The whole consent flow.
16   kConsentFlow,
17   // The speaker id enrollment flow.
18   kSpeakerIdEnrollment,
19   // The speaker id retrain flow.
20   kSpeakerIdRetrain,
21 };
22 
23 // Interface for a class which is responsible for start Assistant OptIn flow.
24 class ASH_PUBLIC_EXPORT AssistantSetup {
25  public:
26   static AssistantSetup* GetInstance();
27 
28   using StartAssistantOptInFlowCallback = base::OnceCallback<void(bool)>;
29 
30   // Start the assistant setup flow.
31   // |completed| is true if the user has completed the entire flow and opted in
32   // to using assistant.
33   virtual void StartAssistantOptInFlow(
34       FlowType type,
35       StartAssistantOptInFlowCallback on_completed) = 0;
36 
37   // Returns true and bounces the opt-in window if it is active.
38   virtual bool BounceOptInWindowIfActive() = 0;
39 
40  protected:
41   AssistantSetup();
42   virtual ~AssistantSetup();
43 
44  private:
45   DISALLOW_COPY_AND_ASSIGN(AssistantSetup);
46 };
47 
48 }  // namespace ash
49 
50 #endif  // ASH_PUBLIC_CPP_ASSISTANT_ASSISTANT_SETUP_H_
51