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 
5 #ifndef ASH_SYSTEM_PHONEHUB_PHONE_HUB_INTERSTITIAL_VIEW_H_
6 #define ASH_SYSTEM_PHONEHUB_PHONE_HUB_INTERSTITIAL_VIEW_H_
7 
8 #include <vector>
9 
10 #include "ash/ash_export.h"
11 #include "ash/system/phonehub/phone_hub_content_view.h"
12 #include "ui/views/controls/progress_bar.h"
13 #include "ui/views/metadata/metadata_header_macros.h"
14 #include "ui/views/view.h"
15 
16 namespace views {
17 class Button;
18 class ImageView;
19 class ImageSkia;
20 class Label;
21 class ProgressBar;
22 }  // namespace views
23 
24 namespace ash {
25 
26 // A generic view to display interstitial pages for the Phone Hub feature with
27 // image, text and buttons in a customized layout. It is reused by the
28 // onboarding, loading, disconnected/reconnecting and error state UI.
29 class ASH_EXPORT PhoneHubInterstitialView : public PhoneHubContentView {
30  public:
31   METADATA_HEADER(PhoneHubInterstitialView);
32 
33   explicit PhoneHubInterstitialView(bool show_progress, bool show_image = true);
34   PhoneHubInterstitialView(const PhoneHubInterstitialView&) = delete;
35   PhoneHubInterstitialView& operator=(const PhoneHubInterstitialView&) = delete;
36   ~PhoneHubInterstitialView() override;
37 
38   void SetImage(const gfx::ImageSkia& image);
39   void SetTitle(const base::string16& title);
40   void SetDescription(const base::string16& desc);
41   void AddButton(std::unique_ptr<views::Button> button);
42 
43  private:
44   // A progress bar will be shown under the title row if |show_progress| is
45   // true.
46   views::ProgressBar* progress_bar_ = nullptr;
47   views::ImageView* image_ = nullptr;
48   views::Label* title_ = nullptr;
49   views::Label* description_ = nullptr;
50   views::View* button_container_ = nullptr;
51 };
52 
53 }  // namespace ash
54 
55 #endif  // ASH_SYSTEM_PHONEHUB_PHONE_HUB_INTERSTITIAL_VIEW_H_
56