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

Unified Diff: chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc

Issue 2278003003: bluetooth: Fix layering violation in BluetoothChooserController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address isherman's comments Created 4 years, 4 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 | « chrome/browser/ui/bluetooth/DEPS ('k') | 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/ui/bluetooth/bluetooth_chooser_controller.cc
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
index 7f877bf6f4caab43e47c388910232fd4f8e3417c..1e8b2b348197ab7056d2e3fd16015879431821e0 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/net/referrer.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -15,7 +16,6 @@
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
-#include "content/browser/bluetooth/bluetooth_metrics.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
@@ -28,6 +28,10 @@ Browser* GetBrowser() {
return browser_displayer.browser();
}
+void RecordInteractionWithChooser(bool has_null_handler) {
+ UMA_HISTOGRAM_BOOLEAN("Bluetooth.Web.ChooserInteraction", has_null_handler);
+}
+
} // namespace
BluetoothChooserController::BluetoothChooserController(
@@ -78,6 +82,7 @@ base::string16 BluetoothChooserController::GetOption(size_t index) const {
}
void BluetoothChooserController::RefreshOptions() {
+ RecordInteractionWithChooser(event_handler_.is_null());
if (event_handler_.is_null())
return;
ClearAllDevices();
@@ -89,10 +94,8 @@ base::string16 BluetoothChooserController::GetStatus() const {
}
void BluetoothChooserController::Select(size_t index) {
+ RecordInteractionWithChooser(event_handler_.is_null());
if (event_handler_.is_null()) {
- content::RecordRequestDeviceOutcome(
- content::UMARequestDeviceOutcome::
- BLUETOOTH_CHOOSER_EVENT_HANDLER_INVALID);
return;
}
DCHECK_LT(index, devices_.size());
@@ -101,6 +104,7 @@ void BluetoothChooserController::Select(size_t index) {
}
void BluetoothChooserController::Cancel() {
+ RecordInteractionWithChooser(event_handler_.is_null());
if (event_handler_.is_null())
return;
event_handler_.Run(content::BluetoothChooser::Event::CANCELLED,
@@ -108,6 +112,7 @@ void BluetoothChooserController::Cancel() {
}
void BluetoothChooserController::Close() {
+ RecordInteractionWithChooser(event_handler_.is_null());
if (event_handler_.is_null())
return;
event_handler_.Run(content::BluetoothChooser::Event::CANCELLED,
« no previous file with comments | « chrome/browser/ui/bluetooth/DEPS ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698