123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- // 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 ASH_WEBUI_SHIMLESS_RMA_SHIMLESS_RMA_H_
- #define ASH_WEBUI_SHIMLESS_RMA_SHIMLESS_RMA_H_
- #include <memory>
- #include "ash/webui/shimless_rma/backend/shimless_rma_service.h"
- #include "ash/webui/shimless_rma/mojom/shimless_rma.mojom-forward.h"
- #include "chromeos/services/network_config/public/mojom/cros_network_config.mojom-forward.h" // nogncheck
- #include "mojo/public/cpp/bindings/pending_receiver.h"
- #include "ui/web_dialogs/web_dialog_ui.h"
- namespace content {
- class WebUI;
- } // namespace content
- namespace ash {
- namespace shimless_rma {
- class ShimlessRmaDelegate;
- // Returns true if RMA is allowed on the device.
- bool IsShimlessRmaAllowed();
- // Returns true if the kLaunchRma switch is detected and RMA is allowed.
- bool HasLaunchRmaSwitchAndIsAllowed();
- } // namespace shimless_rma
- // The WebUI for ShimlessRMA or chrome://shimless-rma.
- class ShimlessRMADialogUI : public ui::MojoWebDialogUI {
- public:
- ShimlessRMADialogUI(
- content::WebUI* web_ui,
- std::unique_ptr<shimless_rma::ShimlessRmaDelegate> shimless_rma_delegate);
- ~ShimlessRMADialogUI() override;
- ShimlessRMADialogUI(const ShimlessRMADialogUI&) = delete;
- ShimlessRMADialogUI& operator=(const ShimlessRMADialogUI&) = delete;
- void BindInterface(
- mojo::PendingReceiver<chromeos::network_config::mojom::CrosNetworkConfig>
- receiver);
- void BindInterface(
- mojo::PendingReceiver<shimless_rma::mojom::ShimlessRmaService> receiver);
- private:
- std::unique_ptr<shimless_rma::ShimlessRmaService> shimless_rma_manager_;
- WEB_UI_CONTROLLER_TYPE_DECL();
- };
- } // namespace ash
- #endif // ASH_WEBUI_SHIMLESS_RMA_SHIMLESS_RMA_H_
|