onboarding_view.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright 2020 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. #ifndef ASH_SYSTEM_PHONEHUB_ONBOARDING_VIEW_H_
  5. #define ASH_SYSTEM_PHONEHUB_ONBOARDING_VIEW_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/system/phonehub/phone_hub_content_view.h"
  8. #include "ash/system/tray/tray_bubble_view.h"
  9. #include "ui/base/metadata/metadata_header_macros.h"
  10. #include "ui/views/controls/button/button.h"
  11. #include "ui/views/view.h"
  12. namespace ash {
  13. class PhoneHubInterstitialView;
  14. namespace phonehub {
  15. class OnboardingUiTracker;
  16. }
  17. // An additional entry point UI to ask the existing multidevice users to opt in
  18. // and set up the Phone feature on this device. Note that this class handles
  19. // both the main onboarding screen and the dismiss prompt together.
  20. class ASH_EXPORT OnboardingView : public PhoneHubContentView {
  21. public:
  22. METADATA_HEADER(OnboardingView);
  23. class Delegate {
  24. public:
  25. virtual void HideStatusHeaderView() = 0;
  26. };
  27. // The different onboarding flows that are supported.
  28. enum OnboardingFlow { kExistingMultideviceUser = 0, kNewMultideviceUser };
  29. OnboardingView(phonehub::OnboardingUiTracker* onboarding_ui_tracker,
  30. Delegate* delegate,
  31. OnboardingFlow onboarding_flow);
  32. OnboardingView(const OnboardingView&) = delete;
  33. OnboardingView& operator=(const OnboardingView&) = delete;
  34. ~OnboardingView() override;
  35. // Update |content_view_| to display the dismiss prompt contents.
  36. // Invoked when user clicks the "Dismiss" button on the main onboarding view.
  37. void ShowDismissPrompt();
  38. // PhoneHubContentView:
  39. void OnBubbleClose() override;
  40. phone_hub_metrics::Screen GetScreenForMetrics() const override;
  41. private:
  42. // The view responsible for displaying the onboarding UI contents.
  43. // Owned by view hierarchy.
  44. PhoneHubInterstitialView* main_view_ = nullptr;
  45. phonehub::OnboardingUiTracker* onboarding_ui_tracker_ = nullptr;
  46. Delegate* delegate_ = nullptr;
  47. };
  48. } // namespace ash
  49. #endif // ASH_SYSTEM_PHONEHUB_ONBOARDING_VIEW_H_