summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/ui/webui/signin/enterprise_profile_welcome_ui.h
blob: 00b15ee97658fd55cbe6fa981ea4001f735bc6c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_ENTERPRISE_PROFILE_WELCOME_UI_H_
#define CHROME_BROWSER_UI_WEBUI_SIGNIN_ENTERPRISE_PROFILE_WELCOME_UI_H_

#include "base/callback.h"
#include "base/memory/raw_ptr.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/webui/signin/signin_utils.h"
#include "content/public/browser/web_ui_controller.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/skia/include/core/SkColor.h"

class Browser;
class EnterpriseProfileWelcomeHandler;
struct AccountInfo;

namespace content {
class WebUI;
}

// TODO(crbug.com/1300109): Rename this and all related files to get rid of
// "Enterprise".
class EnterpriseProfileWelcomeUI : public content::WebUIController {
 public:
  // Type of a welcome screen for the enterprise flow.
  enum class ScreenType {
    kEntepriseAccountSyncEnabled,
    kEntepriseAccountSyncDisabled,
    kConsumerAccountSyncDisabled,
    kEnterpriseAccountCreation,
#if BUILDFLAG(IS_CHROMEOS_LACROS)
    kLacrosConsumerWelcome,
    kLacrosEnterpriseWelcome
#endif
  };

  explicit EnterpriseProfileWelcomeUI(content::WebUI* web_ui);
  ~EnterpriseProfileWelcomeUI() override;

  EnterpriseProfileWelcomeUI(const EnterpriseProfileWelcomeUI&) = delete;
  EnterpriseProfileWelcomeUI& operator=(const EnterpriseProfileWelcomeUI&) =
      delete;

  // Initializes the EnterpriseProfileWelcomeUI.
  void Initialize(Browser* browser,
                  ScreenType type,
                  const AccountInfo& account_info,
                  bool force_new_profile,
                  bool show_link_data_option,
                  absl::optional<SkColor> profile_color,
                  signin::SigninChoiceCallback proceed_callback);

  // Allows tests to trigger page events.
  EnterpriseProfileWelcomeHandler* GetHandlerForTesting();

 private:
  // Stored for tests.
  raw_ptr<EnterpriseProfileWelcomeHandler> handler_ = nullptr;

  WEB_UI_CONTROLLER_TYPE_DECL();
};

#endif  // CHROME_BROWSER_UI_WEBUI_SIGNIN_ENTERPRISE_PROFILE_WELCOME_UI_H_