summaryrefslogtreecommitdiffstats
path: root/ui/chromeos/network
diff options
context:
space:
mode:
Diffstat (limited to 'ui/chromeos/network')
-rw-r--r--ui/chromeos/network/network_connect.cc12
-rw-r--r--ui/chromeos/network/network_connect.h4
-rw-r--r--ui/chromeos/network/network_state_notifier.cc12
-rw-r--r--ui/chromeos/network/network_state_notifier.h4
-rw-r--r--ui/chromeos/network/network_state_notifier_unittest.cc2
5 files changed, 18 insertions, 16 deletions
diff --git a/ui/chromeos/network/network_connect.cc b/ui/chromeos/network/network_connect.cc
index bc9f02e..8222391 100644
--- a/ui/chromeos/network/network_connect.cc
+++ b/ui/chromeos/network/network_connect.cc
@@ -76,7 +76,7 @@ class NetworkConnectImpl : public NetworkConnect {
bool shared) override;
base::string16 GetShillErrorString(const std::string& error,
const std::string& service_path) override;
- void ShowNetworkSettings(const std::string& service_path) override;
+ void ShowNetworkSettingsForPath(const std::string& service_path) override;
private:
void HandleUnconfiguredNetwork(const std::string& service_path);
@@ -159,7 +159,7 @@ void NetworkConnectImpl::HandleUnconfiguredNetwork(
}
// No special configure or setup for |network|, show the settings UI.
if (chromeos::LoginState::Get()->IsUserLoggedIn()) {
- delegate_->ShowNetworkSettings(service_path);
+ ShowNetworkSettingsForPath(service_path);
}
return;
}
@@ -211,7 +211,7 @@ void NetworkConnectImpl::OnConnectFailed(
// Already connected to the network, show the settings UI for the network.
if (error_name == NetworkConnectionHandler::kErrorConnected) {
- ShowNetworkSettings(service_path);
+ ShowNetworkSettingsForPath(service_path);
return;
}
@@ -608,8 +608,10 @@ base::string16 NetworkConnectImpl::GetShillErrorString(
base::UTF8ToUTF16(error));
}
-void NetworkConnectImpl::ShowNetworkSettings(const std::string& service_path) {
- delegate_->ShowNetworkSettings(service_path);
+void NetworkConnectImpl::ShowNetworkSettingsForPath(
+ const std::string& service_path) {
+ const NetworkState* network = GetNetworkState(service_path);
+ delegate_->ShowNetworkSettingsForGuid(network ? network->guid() : "");
}
} // namespace
diff --git a/ui/chromeos/network/network_connect.h b/ui/chromeos/network/network_connect.h
index 540f1ff..29434fb 100644
--- a/ui/chromeos/network/network_connect.h
+++ b/ui/chromeos/network/network_connect.h
@@ -30,7 +30,7 @@ class UI_CHROMEOS_EXPORT NetworkConnect {
// Shows the settings related to network. If |network_id| is not empty,
// show the settings for that network.
- virtual void ShowNetworkSettings(const std::string& network_id) = 0;
+ virtual void ShowNetworkSettingsForGuid(const std::string& network_id) = 0;
// Shows UI to enroll the network specified by |network_id| if appropriate
// and returns true, otherwise returns false.
@@ -103,7 +103,7 @@ class UI_CHROMEOS_EXPORT NetworkConnect {
// Shows the settings for the network specified by |service_path|. If empty,
// or no matching network exists, shows the general internet settings page.
- virtual void ShowNetworkSettings(const std::string& service_path) = 0;
+ virtual void ShowNetworkSettingsForPath(const std::string& service_path) = 0;
protected:
NetworkConnect();
diff --git a/ui/chromeos/network/network_state_notifier.cc b/ui/chromeos/network/network_state_notifier.cc
index 0cfde4a..54245a0 100644
--- a/ui/chromeos/network/network_state_notifier.cc
+++ b/ui/chromeos/network/network_state_notifier.cc
@@ -184,7 +184,7 @@ void NetworkStateNotifier::UpdateCellularOutOfCredits(
ShowErrorNotification(
kNetworkOutOfCreditsNotificationId, cellular->type(),
l10n_util::GetStringUTF16(IDS_NETWORK_OUT_OF_CREDITS_TITLE), error_msg,
- base::Bind(&NetworkStateNotifier::ShowNetworkSettings,
+ base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath,
weak_ptr_factory_.GetWeakPtr(), cellular->path()));
}
}
@@ -218,7 +218,7 @@ void NetworkStateNotifier::UpdateCellularActivating(
l10n_util::GetStringFUTF16(IDS_NETWORK_CELLULAR_ACTIVATED,
base::UTF8ToUTF16((cellular->name()))),
icon, kNotifierNetwork,
- base::Bind(&NetworkStateNotifier::ShowNetworkSettings,
+ base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath,
weak_ptr_factory_.GetWeakPtr(), cellular->path())));
}
@@ -258,7 +258,7 @@ void NetworkStateNotifier::ShowMobileActivationError(
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_AURA_UBER_TRAY_NETWORK_FAILED_CELLULAR),
kNotifierNetworkError,
- base::Bind(&NetworkStateNotifier::ShowNetworkSettings,
+ base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath,
weak_ptr_factory_.GetWeakPtr(), service_path)));
}
@@ -371,13 +371,13 @@ void NetworkStateNotifier::ShowConnectErrorNotification(
ShowErrorNotification(
kNetworkConnectNotificationId, network_type,
l10n_util::GetStringUTF16(IDS_NETWORK_CONNECTION_ERROR_TITLE), error_msg,
- base::Bind(&NetworkStateNotifier::ShowNetworkSettings,
+ base::Bind(&NetworkStateNotifier::ShowNetworkSettingsForPath,
weak_ptr_factory_.GetWeakPtr(), service_path));
}
-void NetworkStateNotifier::ShowNetworkSettings(
+void NetworkStateNotifier::ShowNetworkSettingsForPath(
const std::string& service_path) {
- network_connect_->ShowNetworkSettings(service_path);
+ network_connect_->ShowNetworkSettingsForPath(service_path);
}
} // namespace ui
diff --git a/ui/chromeos/network/network_state_notifier.h b/ui/chromeos/network/network_state_notifier.h
index 092e5fe..a86ec91 100644
--- a/ui/chromeos/network/network_state_notifier.h
+++ b/ui/chromeos/network/network_state_notifier.h
@@ -91,8 +91,8 @@ class UI_CHROMEOS_EXPORT NetworkStateNotifier
void UpdateCellularOutOfCredits(const chromeos::NetworkState* cellular);
void UpdateCellularActivating(const chromeos::NetworkState* cellular);
- // Invokes network_connect_->ShowNetworkSettings from a callback.
- void ShowNetworkSettings(const std::string& service_path);
+ // Invokes network_connect_->ShowNetworkSettingsForPath from a callback.
+ void ShowNetworkSettingsForPath(const std::string& service_path);
NetworkConnect* network_connect_; // unowned
std::string last_default_network_;
diff --git a/ui/chromeos/network/network_state_notifier_unittest.cc b/ui/chromeos/network/network_state_notifier_unittest.cc
index 89b27b8..5b759f6 100644
--- a/ui/chromeos/network/network_state_notifier_unittest.cc
+++ b/ui/chromeos/network/network_state_notifier_unittest.cc
@@ -30,7 +30,7 @@ class NetworkConnectTestDelegate : public NetworkConnect::Delegate {
// NetworkConnect::Delegate
void ShowNetworkConfigure(const std::string& network_id) override {}
- void ShowNetworkSettings(const std::string& network_id) override {}
+ void ShowNetworkSettingsForGuid(const std::string& network_id) override {}
bool ShowEnrollNetwork(const std::string& network_id) override {
return false;
}