summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorcernekee <cernekee@chromium.org>2016-03-16 15:18:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-16 22:22:12 +0000
commit7288268a683040968054a3dcfedef28d9151bc1d (patch)
tree4d0622077d1a0ffbc623a06b39fe87c3595fa34c /ui
parentd4793d5841f84175a0d069391fd612f9cc3f1345 (diff)
downloadchromium_src-7288268a683040968054a3dcfedef28d9151bc1d.zip
chromium_src-7288268a683040968054a3dcfedef28d9151bc1d.tar.gz
chromium_src-7288268a683040968054a3dcfedef28d9151bc1d.tar.bz2
Extend vpnProvider to allow reconnections
Upcoming changes in the Chrome OS networking daemon (shill) will allow third party VPNs to transition "backwards" from Online->Configuring if the default physical connection changes. Add a "reconnect" flag so that VPN apps can signal their compatibility with this new scheme, and add the necessary UI changes so that Chrome can identify reconnections and present them to the user in a sensible way. Also, change the UI so that users can cancel VPN reconnections (and connections) using the "Disconnect" button. BUG=514343 Review URL: https://codereview.chromium.org/1722453002 Cr-Commit-Position: refs/heads/master@{#381566}
Diffstat (limited to 'ui')
-rw-r--r--ui/chromeos/network/network_icon.cc21
-rw-r--r--ui/chromeos/network/network_state_notifier.cc2
-rw-r--r--ui/chromeos/ui_chromeos_strings.grd6
3 files changed, 23 insertions, 6 deletions
diff --git a/ui/chromeos/network/network_icon.cc b/ui/chromeos/network/network_icon.cc
index b1785d6..395bd62 100644
--- a/ui/chromeos/network/network_icon.cc
+++ b/ui/chromeos/network/network_icon.cc
@@ -741,7 +741,12 @@ base::string16 GetLabelForNetwork(const chromeos::NetworkState* network,
DCHECK(network);
std::string activation_state = network->activation_state();
if (icon_type == ICON_TYPE_LIST) {
- // Show "<network>: [Connecting|Activating]..."
+ // Show "<network>: [Connecting|Activating|Reconnecting]..."
+ if (network->IsReconnecting()) {
+ return l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_NETWORK_LIST_RECONNECTING,
+ base::UTF8ToUTF16(network->name()));
+ }
if (network->IsConnectingState()) {
return l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_NETWORK_LIST_CONNECTING,
@@ -760,7 +765,13 @@ base::string16 GetLabelForNetwork(const chromeos::NetworkState* network,
base::UTF8ToUTF16(network->name()));
}
} else {
- // Show "[Connected to|Connecting to|Activating] <network>" (non-list view).
+ // Show "[Connected to|Connecting to|Activating|Reconnecting to] <network>"
+ // (non-list view).
+ if (network->IsReconnecting()) {
+ return l10n_util::GetStringFUTF16(
+ IDS_ASH_STATUS_TRAY_NETWORK_RECONNECTING,
+ base::UTF8ToUTF16(network->name()));
+ }
if (network->IsConnectedState()) {
return l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_NETWORK_CONNECTED,
base::UTF8ToUTF16(network->name()));
@@ -827,10 +838,10 @@ void GetDefaultNetworkImageAndLabel(IconType icon_type,
const NetworkState* network;
// If we are connecting to a network, and there is either no connected
- // network, or the connection was user requested, use the connecting
- // network.
+ // network, or the connection was user requested, or shill triggered a
+ // reconnection, use the connecting network.
if (connecting_network &&
- (!connected_network ||
+ (!connected_network || connecting_network->IsReconnecting() ||
connect_handler->HasConnectingNetwork(connecting_network->path()))) {
network = connecting_network;
} else {
diff --git a/ui/chromeos/network/network_state_notifier.cc b/ui/chromeos/network/network_state_notifier.cc
index af5a2b8..4394cdd 100644
--- a/ui/chromeos/network/network_state_notifier.cc
+++ b/ui/chromeos/network/network_state_notifier.cc
@@ -197,7 +197,7 @@ bool NetworkStateNotifier::UpdateDefaultNetwork(const NetworkState* network) {
void NetworkStateNotifier::UpdateVpnConnectionState(const NetworkState* vpn) {
if (vpn->path() == connected_vpn_) {
- if (!vpn->IsConnectedState()) {
+ if (!vpn->IsConnectedState() && !vpn->IsConnectingState()) {
ShowVpnDisconnectedNotification(vpn);
connected_vpn_.clear();
}
diff --git a/ui/chromeos/ui_chromeos_strings.grd b/ui/chromeos/ui_chromeos_strings.grd
index 67f0971..f49bc36 100644
--- a/ui/chromeos/ui_chromeos_strings.grd
+++ b/ui/chromeos/ui_chromeos_strings.grd
@@ -138,6 +138,9 @@
<message name="IDS_ASH_STATUS_TRAY_NETWORK_CONNECTING" desc="Message for the network tray tooltip and network list when connecting to a network.">
Connecting to <ph name="NAME">$1<ex>GoogleGuest</ex></ph>
</message>
+ <message name="IDS_ASH_STATUS_TRAY_NETWORK_RECONNECTING" desc="Message for the network tray tooltip and network list when reconnecting to a network.">
+ Reconnecting to <ph name="NAME">$1<ex>Company VPN</ex></ph>
+ </message>
<message name="IDS_ASH_STATUS_TRAY_NETWORK_LIST_ACTIVATE" desc="Message for the network list to activate the network.">
Activate <ph name="NETWORKSERVICE">$1<ex>YBH Cellular</ex></ph>
</message>
@@ -147,6 +150,9 @@
<message name="IDS_ASH_STATUS_TRAY_NETWORK_LIST_CONNECTING" desc="Message for the network list when connecting to a network.">
<ph name="NAME">$1<ex>GoogleGuest</ex></ph>: Connecting...
</message>
+ <message name="IDS_ASH_STATUS_TRAY_NETWORK_LIST_RECONNECTING" desc="Message for the network list when reconnecting to a network.">
+ <ph name="NAME">$1<ex>Company VPN</ex></ph>: Reconnecting...
+ </message>
<message name="IDS_ASH_STATUS_TRAY_NETWORK_NOT_CONNECTED" desc="Description in status area or network list when no network is connected.">
No network
</message>