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

Unified Diff: chrome/browser/ui/webui/settings/about_handler.cc

Issue 2897773002: Show proper message in about Chrome OS page (Closed)
Patch Set: Apply fix to patch set 3 Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/help/version_updater_chromeos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/about_handler.cc
diff --git a/chrome/browser/ui/webui/settings/about_handler.cc b/chrome/browser/ui/webui/settings/about_handler.cc
index 2ee8ce7b1a1b8390b67e5c374ea4e9fbc9f2123f..a35e1ee9fde55d660a1b67b5ac79c44411b70845 100644
--- a/chrome/browser/ui/webui/settings/about_handler.cc
+++ b/chrome/browser/ui/webui/settings/about_handler.cc
@@ -69,6 +69,8 @@
#include "chrome/browser/ui/webui/help/version_updater_chromeos.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/power_manager_client.h"
+#include "chromeos/network/network_state.h"
+#include "chromeos/network/network_state_handler.h"
#include "chromeos/system/statistics_provider.h"
#include "components/user_manager/user_manager.h"
#endif
@@ -98,8 +100,19 @@ struct RegulatoryLabel {
// Returns message that informs user that for update it's better to
// connect to a network of one of the allowed types.
base::string16 GetAllowedConnectionTypesMessage() {
- if (help_utils_chromeos::IsUpdateOverCellularAllowed()) {
- return l10n_util::GetStringUTF16(IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED);
+ const chromeos::NetworkState* network = chromeos::NetworkHandler::Get()
+ ->network_state_handler()
+ ->DefaultNetwork();
+ const bool cellular = network && network->IsConnectedState() &&
+ network->type() == shill::kTypeCellular;
+
+ if (help_utils_chromeos::IsUpdateOverCellularAllowed(
+ true /* interactive */)) {
+ return cellular
+ ? l10n_util::GetStringUTF16(
+ IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED_NOT_AUTOMATIC)
+ : l10n_util::GetStringUTF16(
+ IDS_UPGRADE_NETWORK_LIST_CELLULAR_ALLOWED);
} else {
return l10n_util::GetStringUTF16(
IDS_UPGRADE_NETWORK_LIST_CELLULAR_DISALLOWED);
« no previous file with comments | « chrome/browser/ui/webui/help/version_updater_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698