ota_activator.cc 844 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2019 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/services/cellular_setup/ota_activator.h"
  5. #include <utility>
  6. namespace ash::cellular_setup {
  7. OtaActivator::OtaActivator(base::OnceClosure on_finished_callback)
  8. : on_finished_callback_(std::move(on_finished_callback)) {}
  9. OtaActivator::~OtaActivator() = default;
  10. mojo::PendingRemote<mojom::CarrierPortalHandler>
  11. OtaActivator::GenerateRemote() {
  12. // Only one mojo::PendingRemote<> should be created per instance.
  13. DCHECK(!receiver_.is_bound());
  14. return receiver_.BindNewPipeAndPassRemote();
  15. }
  16. void OtaActivator::InvokeOnFinishedCallback() {
  17. DCHECK(on_finished_callback_);
  18. std::move(on_finished_callback_).Run();
  19. }
  20. } // namespace ash::cellular_setup