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

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

Issue 2426473009: mash: Place views Wi-Fi network config dialogs in correct window parent (Closed)
Patch Set: rebase 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_client.cc
diff --git a/chrome/browser/ui/ash/system_tray_client.cc b/chrome/browser/ui/ash/system_tray_client.cc
index 6d70dff123760a2e5baaa38c8888f5a09c1fa37e..b9d4e000d86fc7fa36c1afb4af8f5082ee85ca2e 100644
--- a/chrome/browser/ui/ash/system_tray_client.cc
+++ b/chrome/browser/ui/ash/system_tray_client.cc
@@ -32,6 +32,7 @@
#include "net/base/escape.h"
#include "services/service_manager/public/cpp/connector.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/views/widget/widget_parent.h"
using chromeos::DBusThreadManager;
using chromeos::LoginState;
@@ -198,12 +199,16 @@ void SystemTrayClient::ShowPublicAccountInfo() {
}
void SystemTrayClient::ShowNetworkConfigure(const std::string& service_path) {
- // TODO(jamescook): Consolidate this with the classic ash version from
- // NetworkConnectDelegateChromeOS. This will require moving the window
- // container calculation to this class, then plumbing a container ID through
- // the dialog code.
- CHECK(chrome::IsRunningInMash());
- chromeos::NetworkConfigView::Show(service_path, nullptr /* parent */);
+ // UI is not available at the lock screen.
+ // TODO(mash): Need replacement for SessionStateDelegate. crbug.com/648964
+ if (!chrome::IsRunningInMash() &&
+ ash::WmShell::Get()->GetSessionStateDelegate()->IsScreenLocked())
+ return;
+
+ views::WidgetParent parent;
+ parent.container_id = GetDialogParentContainerId();
+ // Dialog will default to the primary display.
+ chromeos::NetworkConfigView::Show(service_path, parent);
}
void SystemTrayClient::ShowNetworkSettings(const std::string& network_id) {

Powered by Google App Engine
This is Rietveld 408576698