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

Side by Side Diff: ui/chromeos/network/network_state_notifier.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 unified diff | Download patch
« no previous file with comments | « ui/chromeos/network/network_state_notifier.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/chromeos/network/network_state_notifier.h" 5 #include "ui/chromeos/network/network_state_notifier.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 NetworkStateNotifier::~NetworkStateNotifier() { 113 NetworkStateNotifier::~NetworkStateNotifier() {
114 if (!NetworkHandler::IsInitialized()) 114 if (!NetworkHandler::IsInitialized())
115 return; 115 return;
116 NetworkHandler::Get()->network_state_handler()->RemoveObserver(this, 116 NetworkHandler::Get()->network_state_handler()->RemoveObserver(this,
117 FROM_HERE); 117 FROM_HERE);
118 NetworkHandler::Get()->network_connection_handler()->RemoveObserver(this); 118 NetworkHandler::Get()->network_connection_handler()->RemoveObserver(this);
119 } 119 }
120 120
121 void NetworkStateNotifier::ConnectToNetworkRequested(
122 const std::string& service_path) {
123 RemoveConnectNotification();
124 }
125
126 void NetworkStateNotifier::ConnectSucceeded(const std::string& service_path) {
127 RemoveConnectNotification();
128 }
129
130 void NetworkStateNotifier::ConnectFailed(const std::string& service_path, 121 void NetworkStateNotifier::ConnectFailed(const std::string& service_path,
131 const std::string& error_name) { 122 const std::string& error_name) {
132 // Only show a notification for certain errors. Other failures are expected 123 // Only show a notification for certain errors. Other failures are expected
133 // to be handled by the UI that initiated the connect request. 124 // to be handled by the UI that initiated the connect request.
134 // Note: kErrorConnectFailed may also cause the configure dialog to be 125 // Note: kErrorConnectFailed may also cause the configure dialog to be
135 // displayed, but we rely on the notification system to show additional 126 // displayed, but we rely on the notification system to show additional
136 // details if available. 127 // details if available.
137 if (error_name != NetworkConnectionHandler::kErrorConnectFailed && 128 if (error_name != NetworkConnectionHandler::kErrorConnectFailed &&
138 error_name != NetworkConnectionHandler::kErrorNotFound && 129 error_name != NetworkConnectionHandler::kErrorNotFound &&
139 error_name != NetworkConnectionHandler::kErrorConfigureFailed && 130 error_name != NetworkConnectionHandler::kErrorConfigureFailed &&
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 error_msg, base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath, 412 error_msg, base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath,
422 weak_ptr_factory_.GetWeakPtr(), vpn->path())); 413 weak_ptr_factory_.GetWeakPtr(), vpn->path()));
423 } 414 }
424 415
425 void NetworkStateNotifier::ShowNetworkSettingsForPath( 416 void NetworkStateNotifier::ShowNetworkSettingsForPath(
426 const std::string& service_path) { 417 const std::string& service_path) {
427 network_connect_->ShowNetworkSettingsForPath(service_path); 418 network_connect_->ShowNetworkSettingsForPath(service_path);
428 } 419 }
429 420
430 } // namespace ui 421 } // namespace ui
OLDNEW
« no previous file with comments | « ui/chromeos/network/network_state_notifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698