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

Unified Diff: chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc

Issue 10392097: Prevent showing multiple network config views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/chromeos/status/network_menu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc b/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
index 8409d9eed71becc322320978f98ad54688e5cc04..2b0f47296c244998c703e2dd80f3a8ee339399b3 100644
--- a/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc
@@ -1051,13 +1051,6 @@ void InternetOptionsHandler::SetActivationButtonVisibility(
}
}
-void InternetOptionsHandler::CreateModalPopup(views::WidgetDelegate* view) {
- views::Widget* window = views::Widget::CreateWindowWithParent(
- view, GetNativeWindow());
- window->SetAlwaysOnTop(true);
- window->Show();
-}
-
gfx::NativeWindow InternetOptionsHandler::GetNativeWindow() const {
// TODO(beng): This is an improper direct dependency on Browser. Route this
// through some sort of delegate.
@@ -1113,7 +1106,8 @@ void InternetOptionsHandler::HandleWifiButtonClick(
cros_->ForgetNetwork(service_path);
} else if (service_path == kOtherNetworksFakePath) {
// Other wifi networks.
- CreateModalPopup(new chromeos::NetworkConfigView(chromeos::TYPE_WIFI));
+ chromeos::NetworkConfigView::ShowForType(
+ chromeos::TYPE_WIFI, GetNativeWindow());
} else if ((wifi = cros_->FindWifiNetworkByPath(service_path))) {
if (command == "connect") {
wifi->SetEnrollmentDelegate(
@@ -1158,7 +1152,8 @@ void InternetOptionsHandler::HandleVPNButtonClick(
} else if (service_path == kOtherNetworksFakePath) {
// TODO(altimofeev): verify if service_path in condition is correct.
// Other VPN networks.
- CreateModalPopup(new chromeos::NetworkConfigView(chromeos::TYPE_VPN));
+ chromeos::NetworkConfigView::ShowForType(
+ chromeos::TYPE_VPN, GetNativeWindow());
} else if ((network = cros_->FindVirtualNetworkByPath(service_path))) {
if (command == "connect") {
network->SetEnrollmentDelegate(
@@ -1182,7 +1177,7 @@ void InternetOptionsHandler::DoConnect(chromeos::Network* network) {
chromeos::VirtualNetwork* vpn =
static_cast<chromeos::VirtualNetwork*>(network);
if (vpn->NeedMoreInfoToConnect()) {
- CreateModalPopup(new chromeos::NetworkConfigView(network));
+ chromeos::NetworkConfigView::Show(network, GetNativeWindow());
} else {
cros_->ConnectToVirtualNetwork(vpn);
// Connection failures are responsible for updating the UI, including
@@ -1193,7 +1188,7 @@ void InternetOptionsHandler::DoConnect(chromeos::Network* network) {
chromeos::WifiNetwork* wifi = static_cast<chromeos::WifiNetwork*>(network);
if (wifi->IsPassphraseRequired()) {
// Show the connection UI if we require a passphrase.
- CreateModalPopup(new chromeos::NetworkConfigView(wifi));
+ chromeos::NetworkConfigView::Show(wifi, GetNativeWindow());
} else {
cros_->ConnectToWifiNetwork(wifi);
// Connection failures are responsible for updating the UI, including
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698