Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: chrome/browser/signin/easy_unlock_service.cc

Issue 2702683003: Remove Bluetooth adapter status UMA. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/signin/easy_unlock_service.cc
diff --git a/chrome/browser/signin/easy_unlock_service.cc b/chrome/browser/signin/easy_unlock_service.cc
index 1679d3601f249b51b9d9ec1545667904eaf09239..b76ae4306b7b0859b29d7940eb635d7a363f962f 100644
--- a/chrome/browser/signin/easy_unlock_service.cc
+++ b/chrome/browser/signin/easy_unlock_service.cc
@@ -64,21 +64,10 @@
#include "components/signin/core/account_id/account_id.h"
#endif
-#if defined(OS_WIN)
-#include "base/win/windows_version.h"
-#endif
-
using proximity_auth::ScreenlockState;
namespace {
-enum BluetoothType {
- BT_NO_ADAPTER,
- BT_NORMAL,
- BT_LOW_ENERGY_CAPABLE,
- BT_MAX_TYPE
-};
-
PrefService* GetLocalState() {
return g_browser_process ? g_browser_process->local_state() : NULL;
}
@@ -145,32 +134,17 @@ class EasyUnlockService::BluetoothDetector
service_->OnBluetoothAdapterPresentChanged();
}
- device::BluetoothAdapter* getAdapter() {
- return adapter_.get();
- }
-
private:
void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter) {
adapter_ = adapter;
adapter_->AddObserver(this);
service_->OnBluetoothAdapterPresentChanged();
-#if !defined(OS_CHROMEOS)
- // Bluetooth detection causes serious performance degradations on Mac
- // and possibly other platforms as well: http://crbug.com/467316
- // Since this feature is currently only offered for ChromeOS we just
- // turn it off on other platforms once the inforamtion about the
- // adapter has been gathered and reported.
- // TODO(bcwhite,xiyuan): Revisit when non-chromeos platforms are supported.
- adapter_->RemoveObserver(this);
- adapter_ = NULL;
-#else
// TODO(tengs): At the moment, there is no way for Bluetooth discoverability
// to be turned on except through the Easy Unlock setup. If we step on any
// toes in the future then we need to revisit this guard.
if (adapter_->IsDiscoverable())
TurnOffBluetoothDiscoverability();
-#endif // !defined(OS_CHROMEOS)
}
// apps::AppLifetimeMonitor::Observer:
@@ -744,31 +718,20 @@ void EasyUnlockService::InitializeOnAppManagerReady() {
CHECK(app_manager_.get());
InitializeInternal();
+
+#if defined(OS_CHROMEOS)
+ // Only start Bluetooth detection for ChromeOS since the feature is
+ // only offered on ChromeOS. Enabling this on non-ChromeOS platforms
+ // previously introduced a performance regression: http://crbug.com/404482
+ // Make sure not to reintroduce a performance regression if re-enabling on
+ // additional platforms.
+ // TODO(xiyuan): Revisit when non-chromeos platforms are supported.
bluetooth_detector_->Initialize();
+#endif // defined(OS_CHROMEOS)
}
void EasyUnlockService::OnBluetoothAdapterPresentChanged() {
UpdateAppState();
-
- // Whether we've already passed Bluetooth availability information to UMA.
- // This is static because there may be multiple instances and we want to
- // report this system-level stat only once per run of Chrome.
- static bool bluetooth_adapter_has_been_reported = false;
-
- if (!bluetooth_adapter_has_been_reported) {
- bluetooth_adapter_has_been_reported = true;
- int bttype = BT_NO_ADAPTER;
- if (bluetooth_detector_->IsPresent()) {
- bttype = BT_LOW_ENERGY_CAPABLE;
-#if defined(OS_WIN)
- if (base::win::GetVersion() < base::win::VERSION_WIN8) {
- bttype = BT_NORMAL;
- }
-#endif
- }
- UMA_HISTOGRAM_ENUMERATION(
- "EasyUnlock.BluetoothAvailability", bttype, BT_MAX_TYPE);
- }
}
void EasyUnlockService::SetHardlockStateForUser(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698