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

Unified Diff: chrome/browser/ui/webui/help/help_utils_chromeos.cc

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: rebased Created 3 years, 10 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
Index: chrome/browser/ui/webui/help/help_utils_chromeos.cc
diff --git a/chrome/browser/ui/webui/help/help_utils_chromeos.cc b/chrome/browser/ui/webui/help/help_utils_chromeos.cc
index d370f936df302572958a5bc204edef742af6df69..750244d4266045daba1c49a06cd19e35eb85a0d0 100644
--- a/chrome/browser/ui/webui/help/help_utils_chromeos.cc
+++ b/chrome/browser/ui/webui/help/help_utils_chromeos.cc
@@ -12,28 +12,29 @@
#include "base/values.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/grit/generated_resources.h"
+#include "chromeos/chromeos_switches.h"
#include "chromeos/network/network_type_pattern.h"
#include "chromeos/settings/cros_settings_names.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
#include "ui/base/l10n/l10n_util.h"
-namespace {
-
-const bool kDefaultUpdateOverCellularAllowed = false;
-
-} // namespace
-
namespace help_utils_chromeos {
bool IsUpdateOverCellularAllowed() {
+ // If this is a Cellular First device, the default is to allow updates
+ // over cellular.
+ bool default_update_over_cellular_allowed =
+ chromeos::switches::IsCellularFirstDevice();
+
+ // Device Policy overrides the defaults.
chromeos::CrosSettings* settings = chromeos::CrosSettings::Get();
if (!settings)
- return kDefaultUpdateOverCellularAllowed;
+ return default_update_over_cellular_allowed;
const base::Value* raw_types_value =
settings->GetPref(chromeos::kAllowedConnectionTypesForUpdate);
if (!raw_types_value)
- return kDefaultUpdateOverCellularAllowed;
+ return default_update_over_cellular_allowed;
const base::ListValue* types_value;
CHECK(raw_types_value->GetAsList(&types_value));
for (size_t i = 0; i < types_value->GetSize(); ++i) {
@@ -45,7 +46,7 @@ bool IsUpdateOverCellularAllowed() {
if (connection_type == 4)
return true;
}
- return kDefaultUpdateOverCellularAllowed;
+ return default_update_over_cellular_allowed;
}
base::string16 GetConnectionTypeAsUTF16(const std::string& type) {
« no previous file with comments | « chrome/browser/chromeos/policy/device_network_configuration_updater.cc ('k') | chromeos/chromeos_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698