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

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

Issue 2694923005: Appropriate handling for Cellular First devices. (Closed)
Patch Set: 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..43b601197b2e67906d25340c98854f4b54813d41 100644
--- a/chrome/browser/ui/webui/help/help_utils_chromeos.cc
+++ b/chrome/browser/ui/webui/help/help_utils_chromeos.cc
@@ -8,10 +8,12 @@
#include <algorithm>
+#include "base/command_line.h"
#include "base/logging.h"
#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"
@@ -26,14 +28,23 @@ const bool kDefaultUpdateOverCellularAllowed = false;
namespace help_utils_chromeos {
bool IsUpdateOverCellularAllowed() {
+ bool updateOverCellularAllowed = kDefaultUpdateOverCellularAllowed;
xiyuan 2017/02/14 17:06:10 updateOverCellularAllowed -> default_update_over_c
kumarniranjan 2017/02/28 19:01:39 Done.
+
+ // If this is a Cellular First device, allow updates over cellular.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kCellularFirst)) {
+ updateOverCellularAllowed = true;
+ }
+
+ // Device Policy overrides the defaults.
chromeos::CrosSettings* settings = chromeos::CrosSettings::Get();
if (!settings)
- return kDefaultUpdateOverCellularAllowed;
+ return updateOverCellularAllowed;
const base::Value* raw_types_value =
settings->GetPref(chromeos::kAllowedConnectionTypesForUpdate);
if (!raw_types_value)
- return kDefaultUpdateOverCellularAllowed;
+ return updateOverCellularAllowed;
const base::ListValue* types_value;
CHECK(raw_types_value->GetAsList(&types_value));
for (size_t i = 0; i < types_value->GetSize(); ++i) {
@@ -45,7 +56,7 @@ bool IsUpdateOverCellularAllowed() {
if (connection_type == 4)
return true;
}
- return kDefaultUpdateOverCellularAllowed;
+ return updateOverCellularAllowed;
}
base::string16 GetConnectionTypeAsUTF16(const std::string& type) {

Powered by Google App Engine
This is Rietveld 408576698