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

Unified Diff: ui/chromeos/network/network_connect.cc

Issue 1085993002: Revert of Use networkingPrivate.startConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430115_internet_options_cellular
Patch Set: Created 5 years, 8 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 | « components/onc/docs/onc_spec.html ('k') | ui/chromeos/network/network_state_notifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/chromeos/network/network_connect.cc
diff --git a/ui/chromeos/network/network_connect.cc b/ui/chromeos/network/network_connect.cc
index e492f1273ca5cea7ba6318cf6c4dd34c2f25f167..380a6db8229e473d2365d692518c121f858b7096 100644
--- a/ui/chromeos/network/network_connect.cc
+++ b/ui/chromeos/network/network_connect.cc
@@ -207,6 +207,20 @@
scoped_ptr<base::DictionaryValue> error_data) {
NET_LOG_ERROR("Connect Failed: " + error_name, service_path);
+ // If a new connect attempt canceled this connect, or a connect attempt to
+ // the same network is in progress, no need to notify the user here since they
+ // will be notified when the new or existing attempt completes.
+ if (error_name == NetworkConnectionHandler::kErrorConnectCanceled ||
+ error_name == NetworkConnectionHandler::kErrorConnecting) {
+ return;
+ }
+
+ // Already connected to the network, show the settings UI for the network.
+ if (error_name == NetworkConnectionHandler::kErrorConnected) {
+ ShowNetworkSettingsForPath(service_path);
+ return;
+ }
+
if (error_name == NetworkConnectionHandler::kErrorBadPassphrase ||
error_name == NetworkConnectionHandler::kErrorPassphraseRequired ||
error_name == NetworkConnectionHandler::kErrorConfigurationRequired ||
@@ -233,6 +247,7 @@
void NetworkConnectImpl::OnConnectSucceeded(const std::string& service_path) {
NET_LOG_USER("Connect Succeeded", service_path);
+ network_state_notifier_->RemoveConnectNotification();
}
// If |check_error_state| is true, error state for the network is checked,
@@ -240,6 +255,7 @@
// networks or repeat connect attempts).
void NetworkConnectImpl::CallConnectToNetwork(const std::string& service_path,
bool check_error_state) {
+ network_state_notifier_->RemoveConnectNotification();
NetworkHandler::Get()->network_connection_handler()->ConnectToNetwork(
service_path, base::Bind(&NetworkConnectImpl::OnConnectSucceeded,
weak_factory_.GetWeakPtr(), service_path),
« no previous file with comments | « components/onc/docs/onc_spec.html ('k') | ui/chromeos/network/network_state_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698