Commit 35ff0677 authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

Smart Lock: Remove EasyUnlock app monitoring.

The app doesn't change state anymore so there is nothing to monitor.

R=hansberry@chromium.org

Bug: 899324
Test: none
Change-Id: I7daa43cb9137e37b3f38cece458d7aa921239f46
Reviewed-on: https://chromium-review.googlesource.com/c/1315351Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605019}
parent 1163df95
...@@ -82,20 +82,14 @@ EasyUnlockService* EasyUnlockService::GetForUser( ...@@ -82,20 +82,14 @@ EasyUnlockService* EasyUnlockService::GetForUser(
} }
class EasyUnlockService::BluetoothDetector class EasyUnlockService::BluetoothDetector
: public device::BluetoothAdapter::Observer, : public device::BluetoothAdapter::Observer {
public apps::AppLifetimeMonitor::Observer {
public: public:
explicit BluetoothDetector(EasyUnlockService* service) explicit BluetoothDetector(EasyUnlockService* service)
: service_(service), weak_ptr_factory_(this) { : service_(service), weak_ptr_factory_(this) {}
apps::AppLifetimeMonitorFactory::GetForBrowserContext(service_->profile())
->AddObserver(this);
}
~BluetoothDetector() override { ~BluetoothDetector() override {
if (adapter_.get()) if (adapter_.get())
adapter_->RemoveObserver(this); adapter_->RemoveObserver(this);
apps::AppLifetimeMonitorFactory::GetForBrowserContext(service_->profile())
->RemoveObserver(this);
} }
void Initialize() { void Initialize() {
...@@ -128,21 +122,6 @@ class EasyUnlockService::BluetoothDetector ...@@ -128,21 +122,6 @@ class EasyUnlockService::BluetoothDetector
TurnOffBluetoothDiscoverability(); TurnOffBluetoothDiscoverability();
} }
// apps::AppLifetimeMonitor::Observer:
void OnAppDeactivated(content::BrowserContext* context,
const std::string& app_id) override {
// TODO(tengs): Refactor the lifetime management to EasyUnlockAppManager.
if (app_id == extension_misc::kEasyUnlockAppId)
TurnOffBluetoothDiscoverability();
}
void OnAppStop(content::BrowserContext* context,
const std::string& app_id) override {
// TODO(tengs): Refactor the lifetime management to EasyUnlockAppManager.
if (app_id == extension_misc::kEasyUnlockAppId)
TurnOffBluetoothDiscoverability();
}
void TurnOffBluetoothDiscoverability() { void TurnOffBluetoothDiscoverability() {
if (adapter_) { if (adapter_) {
adapter_->SetDiscoverable(false, base::DoNothing(), base::DoNothing()); adapter_->SetDiscoverable(false, base::DoNothing(), base::DoNothing());
......
...@@ -25,7 +25,6 @@ const char kCloudPrintAppId[] = "mfehgcgbbipciphmccgaenjidiccnmng"; ...@@ -25,7 +25,6 @@ const char kCloudPrintAppId[] = "mfehgcgbbipciphmccgaenjidiccnmng";
const char kDataSaverExtensionId[] = "pfmgfdlgomnbgkofeojodiodmgpgmkac"; const char kDataSaverExtensionId[] = "pfmgfdlgomnbgkofeojodiodmgpgmkac";
const char kDriveExtensionId[] = "ghbmnnjooekpmoecnnnilnnbdlolhkhi"; const char kDriveExtensionId[] = "ghbmnnjooekpmoecnnnilnnbdlolhkhi";
const char kDriveHostedAppId[] = "apdfllckaahabafndbhieahigkjlhalf"; const char kDriveHostedAppId[] = "apdfllckaahabafndbhieahigkjlhalf";
const char kEasyUnlockAppId[] = "mkaemigholebcgchlkbankmihknojeak";
const char kEnterpriseWebStoreAppId[] = "afchcafgojfnemjkcbhfekplkmjaldaa"; const char kEnterpriseWebStoreAppId[] = "afchcafgojfnemjkcbhfekplkmjaldaa";
const char kGmailAppId[] = "pjkljhegncpnkpknbcohdijeoejaedia"; const char kGmailAppId[] = "pjkljhegncpnkpknbcohdijeoejaedia";
const char kGoogleDocAppId[] = "aohghmighlieiainnegkcijnfilokake"; const char kGoogleDocAppId[] = "aohghmighlieiainnegkcijnfilokake";
......
...@@ -48,9 +48,6 @@ extern const char kDriveExtensionId[]; ...@@ -48,9 +48,6 @@ extern const char kDriveExtensionId[];
// The extension id of the Drive hosted app. // The extension id of the Drive hosted app.
extern const char kDriveHostedAppId[]; extern const char kDriveHostedAppId[];
// The extension id of the Easy Unlock component application.
extern const char kEasyUnlockAppId[];
// The extension id of the Enterprise Web Store component application. // The extension id of the Enterprise Web Store component application.
extern const char kEnterpriseWebStoreAppId[]; extern const char kEnterpriseWebStoreAppId[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment