phone_connecting_view.cc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #include "ash/system/phonehub/phone_connecting_view.h"
  5. #include <algorithm>
  6. #include <memory>
  7. #include <string>
  8. #include "ash/public/cpp/resources/grit/ash_public_unscaled_resources.h"
  9. #include "ash/strings/grit/ash_strings.h"
  10. #include "ash/system/phonehub/phone_hub_interstitial_view.h"
  11. #include "ash/system/phonehub/phone_hub_metrics.h"
  12. #include "ash/system/phonehub/phone_hub_view_ids.h"
  13. #include "ui/base/l10n/l10n_util.h"
  14. #include "ui/base/metadata/metadata_impl_macros.h"
  15. #include "ui/base/resource/resource_bundle.h"
  16. #include "ui/views/layout/fill_layout.h"
  17. namespace ash {
  18. using phone_hub_metrics::InterstitialScreenEvent;
  19. using phone_hub_metrics::Screen;
  20. PhoneConnectingView::PhoneConnectingView() {
  21. SetID(PhoneHubViewID::kPhoneConnectingView);
  22. SetLayoutManager(std::make_unique<views::FillLayout>());
  23. content_view_ = AddChildView(
  24. std::make_unique<PhoneHubInterstitialView>(/*show_progress=*/true));
  25. content_view_->SetImage(
  26. ui::ResourceBundle::GetSharedInstance().GetThemedLottieImageNamed(
  27. IDR_PHONE_HUB_CONNECTING_IMAGE));
  28. content_view_->SetTitle(l10n_util::GetStringUTF16(
  29. IDS_ASH_PHONE_HUB_PHONE_CONNECTING_DIALOG_TITLE));
  30. content_view_->SetDescription(l10n_util::GetStringUTF16(
  31. IDS_ASH_PHONE_HUB_PHONE_CONNECTING_DIALOG_DESCRIPTION));
  32. LogInterstitialScreenEvent(InterstitialScreenEvent::kShown);
  33. }
  34. PhoneConnectingView::~PhoneConnectingView() = default;
  35. phone_hub_metrics::Screen PhoneConnectingView::GetScreenForMetrics() const {
  36. return Screen::kPhoneConnecting;
  37. }
  38. BEGIN_METADATA(PhoneConnectingView, views::View)
  39. END_METADATA
  40. } // namespace ash