forked from brave/brave-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Safety Tips component and feature (fixes brave/brave-browser#1…
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
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
27 changes: 27 additions & 0 deletions
27
chromium_src/chrome/browser/component_updater/safety_tips_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,27 @@ | ||
/* 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 RegisterSafetyTipsComponent RegisterSafetyTipsComponent_ChromiumImpl | ||
#include "../../../../../chrome/browser/component_updater/safety_tips_component_installer.cc" // NOLINT | ||
#undef RegisterSafetyTipsComponent | ||
|
||
#include "chrome/browser/component_updater/component_updater_utils.h" | ||
#include "components/component_updater/component_updater_service.h" | ||
|
||
namespace component_updater { | ||
|
||
const char kSafetyTipsComponentId[] = "jflookgnkcckhobaglndicnbbgbonegd"; | ||
|
||
void OnSafetyTipsRegistered() { | ||
component_updater::BraveOnDemandUpdate(kSafetyTipsComponentId); | ||
} | ||
|
||
void RegisterSafetyTipsComponent(ComponentUpdateService* cus) { | ||
auto installer = base::MakeRefCounted<ComponentInstaller>( | ||
std::make_unique<SafetyTipsComponentInstallerPolicy>()); | ||
installer->Register(cus, base::Bind(&OnSafetyTipsRegistered)); | ||
} | ||
|
||
} // namespace component_updater |
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