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

Side by Side Diff: ui/chromeos/network/network_state_notifier.cc

Issue 1043343002: 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
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
121 void NetworkStateNotifier::ConnectFailed(const std::string& service_path, 126 void NetworkStateNotifier::ConnectFailed(const std::string& service_path,
122 const std::string& error_name) { 127 const std::string& error_name) {
123 // Only show a notification for certain errors. Other failures are expected 128 // Only show a notification for certain errors. Other failures are expected
124 // to be handled by the UI that initiated the connect request. 129 // to be handled by the UI that initiated the connect request.
125 // Note: kErrorConnectFailed may also cause the configure dialog to be 130 // Note: kErrorConnectFailed may also cause the configure dialog to be
126 // displayed, but we rely on the notification system to show additional 131 // displayed, but we rely on the notification system to show additional
127 // details if available. 132 // details if available.
128 if (error_name != NetworkConnectionHandler::kErrorConnectFailed && 133 if (error_name != NetworkConnectionHandler::kErrorConnectFailed &&
129 error_name != NetworkConnectionHandler::kErrorNotFound && 134 error_name != NetworkConnectionHandler::kErrorNotFound &&
130 error_name != NetworkConnectionHandler::kErrorConfigureFailed && 135 error_name != NetworkConnectionHandler::kErrorConfigureFailed &&
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 error_msg, base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath, 417 error_msg, base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath,
413 weak_ptr_factory_.GetWeakPtr(), vpn->path())); 418 weak_ptr_factory_.GetWeakPtr(), vpn->path()));
414 } 419 }
415 420
416 void NetworkStateNotifier::ShowNetworkSettingsForPath( 421 void NetworkStateNotifier::ShowNetworkSettingsForPath(
417 const std::string& service_path) { 422 const std::string& service_path) {
418 network_connect_->ShowNetworkSettingsForPath(service_path); 423 network_connect_->ShowNetworkSettingsForPath(service_path);
419 } 424 }
420 425
421 } // namespace ui 426 } // namespace ui
OLDNEW
« ui/chromeos/network/network_connect.cc ('K') | « 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