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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.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/chromeos/bluetooth/bluetooth_pairing_dialog.cc
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc b/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc
index e89d7e65c5d781bc715ed4465f76f7807e6c282d..8de70c711a81f34f078bfccabb80fc9cfa42d2aa 100644
--- a/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h"
+#include <string>
+
+#include "ash/public/cpp/shell_window_ids.h"
#include "base/json/json_writer.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser_dialogs.h"
@@ -30,10 +33,8 @@ const int kDefaultHeight = 280;
// BluetoothPairingDialog, public:
BluetoothPairingDialog::BluetoothPairingDialog(
- gfx::NativeWindow parent_window,
const device::BluetoothDevice* device)
- : parent_window_(parent_window),
- webui_(nullptr) {
+ : webui_(nullptr) {
device_data_.SetString("address", device->GetAddress());
device_data_.SetString("name", device->GetNameForDisplay());
device_data_.SetBoolean("paired", device->IsPaired());
@@ -43,12 +44,15 @@ BluetoothPairingDialog::BluetoothPairingDialog(
BluetoothPairingDialog::~BluetoothPairingDialog() {
}
-void BluetoothPairingDialog::Show() {
+void BluetoothPairingDialog::ShowInContainer(int container_id) {
+ // Dialog must be in a modal window container.
+ DCHECK(container_id == ash::kShellWindowId_SystemModalContainer ||
+ container_id == ash::kShellWindowId_LockSystemModalContainer);
+
// Bluetooth settings are currently stored on the device, accessible for
// everyone who uses the machine. As such we can use the active user profile.
- chrome::ShowWebDialog(parent_window_,
- ProfileManager::GetActiveUserProfile(),
- this);
+ chrome::ShowWebDialogInContainer(
+ container_id, ProfileManager::GetActiveUserProfile(), this);
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_pairing_dialog.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698