-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable the FileTypePolicies Chromium component.
This is needed for the download protection component of Safe Browsing.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
chromium_src/chrome/browser/component_updater/file_type_policies_component_installer.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |