summaryrefslogtreecommitdiffstats
path: root/ui/chromeos
diff options
context:
space:
mode:
authorstevenjb <stevenjb@chromium.org>2015-03-14 11:32:24 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-14 18:33:09 +0000
commit82dbc53092955f8609b402be88183693d4e19718 (patch)
treefc74f613e096088a826bd8e22ee06b249bd047b9 /ui/chromeos
parent3aa113195dea4d4fcd20686d4414abb97c75f72a (diff)
downloadchromium_src-82dbc53092955f8609b402be88183693d4e19718.zip
chromium_src-82dbc53092955f8609b402be88183693d4e19718.tar.gz
chromium_src-82dbc53092955f8609b402be88183693d4e19718.tar.bz2
Use GUID instead of servicePath in network settings
* Uses guid instead of service path in the Internet Settings UI * Uses chrome://settings/internet?guid= instead of ?servicePath= * Uses chrome.networkingPrivate.getManagedProperties and setProperties directly in Internet Settings * Makes callback parameter optional in networkingPrivate for setters * Removes the difficult to maintain (and only partially implemented) Error translation from internet setigns, adding a general TODO for translating ONC properties in the UI. * Replaces ShowNetworkSettings with ShowNetworkSettingsForGuid in NetworkConnect::Delegate and ash::SystemTrayDelegate * Uses guid instead of service path in UIProxyConfigService BUG=467275 For chrome/browser/ui/ash: TBR=oshima@chromium.org Review URL: https://codereview.chromium.org/983823002 Cr-Commit-Position: refs/heads/master@{#320662}
Diffstat (limited to 'ui/chromeos')
-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;
}