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

Unified Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.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/webui/options/chromeos/internet_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
index 1bf90c7cc2dc91929a9ea0f84ec1c41b3b71cda1..786276123293a0ee54bdb146cb04350fec6436e5 100644
--- a/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc
@@ -38,6 +38,7 @@
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/webui/web_ui_util.h"
#include "ui/chromeos/network/network_connect.h"
+#include "ui/views/widget/widget_parent.h"
namespace chromeos {
namespace options {
@@ -190,6 +191,12 @@ gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const {
return web_ui()->GetWebContents()->GetTopLevelNativeWindow();
}
+views::WidgetParent InternetOptionsHandler::GetWidgetParent() const {
+ views::WidgetParent widget_parent;
+ widget_parent.native_parent = GetNativeWindow();
+ return widget_parent;
+}
+
const PrefService* InternetOptionsHandler::GetPrefs() const {
return Profile::FromWebUI(web_ui())->GetPrefs();
}
@@ -198,7 +205,7 @@ const PrefService* InternetOptionsHandler::GetPrefs() const {
void InternetOptionsHandler::AddVPNConnection(const base::ListValue* args) {
if (args->empty()) {
// Show the "add network" dialog for the built-in OpenVPN/L2TP provider.
- NetworkConfigView::ShowForType(shill::kTypeVPN, GetNativeWindow());
+ NetworkConfigView::ShowForType(shill::kTypeVPN, GetWidgetParent());
return;
}
@@ -221,7 +228,7 @@ void InternetOptionsHandler::AddNonVPNConnection(const base::ListValue* args) {
return;
}
if (onc_type == ::onc::network_type::kWiFi) {
- NetworkConfigView::ShowForType(shill::kTypeWifi, GetNativeWindow());
+ NetworkConfigView::ShowForType(shill::kTypeWifi, GetWidgetParent());
} else if (onc_type == ::onc::network_type::kCellular) {
ChooseMobileNetworkDialog::ShowDialog(GetNativeWindow());
} else {
@@ -263,7 +270,7 @@ void InternetOptionsHandler::ConfigureNetwork(const base::ListValue* args) {
return;
}
- NetworkConfigView::Show(service_path, GetNativeWindow());
+ NetworkConfigView::Show(service_path, GetWidgetParent());
}
} // namespace options

Powered by Google App Engine
This is Rietveld 408576698