cast_web_contents_observer.cc 657 B

1234567891011121314151617181920212223
  1. // Copyright 2021 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 "chromecast/browser/cast_web_contents_observer.h"
  5. namespace chromecast {
  6. CastWebContentsObserver::CastWebContentsObserver() = default;
  7. CastWebContentsObserver::~CastWebContentsObserver() = default;
  8. void CastWebContentsObserver::Observe(
  9. mojom::CastWebContents* cast_web_contents) {
  10. if (receiver_.is_bound()) {
  11. receiver_.reset();
  12. }
  13. if (cast_web_contents) {
  14. cast_web_contents->AddObserver(receiver_.BindNewPipeAndPassRemote());
  15. }
  16. }
  17. } // namespace chromecast