/* Copyright (c) 2020 The Brave Authors. All rights reserved. * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "brave/browser/update_util.h" #include "base/command_line.h" #include "brave/components/constants/brave_switches.h" #include "content/public/common/content_switches.h" namespace brave { bool UpdateEnabled() { #if defined(OFFICIAL_BUILD) const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); return !cmdline->HasSwitch(switches::kDisableBraveUpdate) && // Don't check for updates in browser tests. !cmdline->HasSwitch(switches::kTestType); #else return false; #endif } } // namespace brave