Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fast Pair] Connect RetroactivePairingDetector to Mediator
Connects RetroactivePairingDetector to the Mediator, which OnRetroactivePairFound triggers the ShowAssociateAccount in the UIBroker. Right now, no logic is added when the user presses Save on the notification, and the account key write will be added in a follow up change. Change-Id: Ic24f249e53c3fd1ca665b0919d1a1b883235add1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3206332 Commit-Queue: Juliet Levesque <julietlevesque@google.com> Reviewed-by: Shane Fitzpatrick <shanefitz@google.com> Cr-Commit-Position: refs/heads/main@{#940456}
- Loading branch information
1 parent
a2ec5a4
commit c4fb9f2
Showing
10 changed files
with
158 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
ash/quick_pair/pairing/fake_retroactive_pairing_detector.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// 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. | ||
|
||
#include "ash/quick_pair/pairing/fake_retroactive_pairing_detector.h" | ||
|
||
#include "ash/quick_pair/common/device.h" | ||
|
||
namespace ash { | ||
namespace quick_pair { | ||
|
||
FakeRetroactivePairingDetector::FakeRetroactivePairingDetector() = default; | ||
|
||
FakeRetroactivePairingDetector::~FakeRetroactivePairingDetector() = default; | ||
|
||
void FakeRetroactivePairingDetector::AddObserver(Observer* observer) { | ||
observers_.AddObserver(observer); | ||
} | ||
|
||
void FakeRetroactivePairingDetector::RemoveObserver(Observer* observer) { | ||
observers_.RemoveObserver(observer); | ||
} | ||
|
||
void FakeRetroactivePairingDetector::NotifyRetroactivePairFound( | ||
scoped_refptr<Device> device) { | ||
for (auto& obs : observers_) | ||
obs.OnRetroactivePairFound(device); | ||
} | ||
|
||
} // namespace quick_pair | ||
} // namespace ash |
37 changes: 37 additions & 0 deletions
37
ash/quick_pair/pairing/fake_retroactive_pairing_detector.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// 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_QUICK_PAIR_PAIRING_FAKE_RETROACTIVE_PAIRING_DETECTOR_H_ | ||
#define ASH_QUICK_PAIR_PAIRING_FAKE_RETROACTIVE_PAIRING_DETECTOR_H_ | ||
|
||
#include "ash/quick_pair/pairing/retroactive_pairing_detector.h" | ||
#include "base/observer_list.h" | ||
#include "third_party/abseil-cpp/absl/types/optional.h" | ||
|
||
namespace ash { | ||
namespace quick_pair { | ||
|
||
struct Device; | ||
|
||
class FakeRetroactivePairingDetector : public RetroactivePairingDetector { | ||
public: | ||
FakeRetroactivePairingDetector(); | ||
FakeRetroactivePairingDetector(const FakeRetroactivePairingDetector&) = | ||
delete; | ||
FakeRetroactivePairingDetector& operator=( | ||
const FakeRetroactivePairingDetector&) = delete; | ||
~FakeRetroactivePairingDetector() override; | ||
|
||
void AddObserver(Observer* observer) override; | ||
void RemoveObserver(Observer* observer) override; | ||
void NotifyRetroactivePairFound(scoped_refptr<Device> device); | ||
|
||
private: | ||
base::ObserverList<Observer> observers_; | ||
}; | ||
|
||
} // namespace quick_pair | ||
} // namespace ash | ||
|
||
#endif // ASH_QUICK_PAIR_PAIRING_FAKE_RETROACTIVE_PAIRING_DETECTOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters