Skip to content

Commit

Permalink
Enable the FileTypePolicies Chromium component.
Browse files Browse the repository at this point in the history
This is needed for the download protection component of Safe Browsing.
  • Loading branch information
fmarier committed Oct 19, 2020
1 parent 5df0be0 commit e4c5530
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* 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 https://mozilla.org/MPL/2.0/. */

#define RegisterFileTypePoliciesComponent \
RegisterFileTypePoliciesComponent_ChromiumImpl
#include "../../../../../chrome/browser/component_updater/file_type_policies_component_installer.cc" // NOLINT
#undef RegisterFileTypePoliciesComponent

#include "chrome/browser/component_updater/component_updater_utils.h"
#include "components/component_updater/component_updater_service.h"

namespace component_updater {

const char kFileTypePoliciesComponentId[] = "khaoiebndkojlmppeemjhbpbandiljpe";

void OnFileTypePoliciesRegistered() {
component_updater::BraveOnDemandUpdate(kFileTypePoliciesComponentId);
}

void RegisterFileTypePoliciesComponent(ComponentUpdateService* cus,
const base::FilePath& user_data_dir) {
auto installer = base::MakeRefCounted<ComponentInstaller>(
std::make_unique<FileTypePoliciesComponentInstallerPolicy>());
installer->Register(cus, base::Bind(&OnFileTypePoliciesRegistered));
}

} // namespace component_updater

0 comments on commit e4c5530

Please sign in to comment.