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

Unified Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 2446403003: chromeos: Convert bluetooth pairing dialog to work with mash, part 1 (Closed)
Patch Set: Created 4 years, 2 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
Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
index 7c4c33f2ae70efd87104812477b16d145b577569..cff502b8a3b6e44e067817a83058e9b26b06b148 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -37,6 +37,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
+#include "base/metrics/user_metrics.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/sys_info.h"
@@ -475,19 +476,19 @@ void SystemTrayDelegateChromeOS::ConnectToBluetoothDevice(
if (device->IsPaired() && !device->IsConnectable())
return;
if (device->IsPaired() || !device->IsPairable()) {
- ash::WmShell::Get()->RecordUserMetricsAction(
- ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_KNOWN_DEVICE);
+ base::RecordAction(
+ base::UserMetricsAction("StatusArea_Bluetooth_Connect_Known"));
device->Connect(NULL,
base::Bind(&base::DoNothing),
base::Bind(&BluetoothDeviceConnectError));
- } else { // Show paring dialog for the unpaired device.
- ash::WmShell::Get()->RecordUserMetricsAction(
- ash::UMA_STATUS_AREA_BLUETOOTH_CONNECT_UNKNOWN_DEVICE);
- BluetoothPairingDialog* dialog =
- new BluetoothPairingDialog(GetNativeWindow(), device);
- // The dialog deletes itself on close.
- dialog->Show();
+ return;
}
+ // Show pairing dialog for the unpaired device.
+ base::RecordAction(
+ base::UserMetricsAction("StatusArea_Bluetooth_Connect_Unknown"));
+ BluetoothPairingDialog* dialog = new BluetoothPairingDialog(device);
+ // The dialog deletes itself on close.
+ dialog->ShowInContainer(SystemTrayClient::GetDialogParentContainerId());
}
bool SystemTrayDelegateChromeOS::IsBluetoothDiscovering() {

Powered by Google App Engine
This is Rietveld 408576698