blob: 34aab854386b01d46483c3a37cfcc293d7b4f140 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2013 The Chromium Authors
[email protected]7207a9c2013-06-08 00:18:092// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/ui/webui/help/help_utils_chromeos.h"
6
avi0f233432015-12-25 02:23:387#include <stddef.h>
8
[email protected]7207a9c2013-06-08 00:18:099#include <algorithm>
10
Yeunjoo Choi6baf3062021-11-08 02:51:1011#include "ash/components/settings/cros_settings_names.h"
Henrique Ferreirof3fbcea22021-02-05 23:12:1912#include "ash/constants/ash_switches.h"
[email protected]7207a9c2013-06-08 00:18:0913#include "base/logging.h"
14#include "base/values.h"
Yeunjoo Choi5097e9c2021-02-25 08:46:5215#include "chrome/browser/ash/settings/cros_settings.h"
[email protected]7207a9c2013-06-08 00:18:0916
[email protected]7207a9c2013-06-08 00:18:0917namespace help_utils_chromeos {
18
weidongga02f7da2017-05-23 17:12:1119bool IsUpdateOverCellularAllowed(bool interactive) {
20 // If this is a Cellular First device or the user actively checks for update,
21 // the default is to allow updates over cellular.
kumarniranjanb9afef62017-03-02 21:42:2222 bool default_update_over_cellular_allowed =
Henrique Ferreiro93dd33b2022-01-18 16:06:4523 interactive ? true : ash::switches::IsCellularFirstDevice();
kumarniranjanb9afef62017-03-02 21:42:2224
25 // Device Policy overrides the defaults.
Yeunjoo Choid461f872021-03-11 06:52:1926 ash::CrosSettings* settings = ash::CrosSettings::Get();
[email protected]7207a9c2013-06-08 00:18:0927 if (!settings)
kumarniranjanb9afef62017-03-02 21:42:2228 return default_update_over_cellular_allowed;
[email protected]7207a9c2013-06-08 00:18:09