Skip to content

Commit

Permalink
Enable Safety Tips component and feature (fixes brave/brave-browser#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarier committed Jan 5, 2021
1 parent 4a6a718 commit 0638cfc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "components/omnibox/common/omnibox_features.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/safe_browsing/core/features.h"
#include "components/security_state/core/features.h"
#include "components/sync/base/sync_base_switches.h"
#include "components/translate/core/browser/translate_prefs.h"
#include "components/variations/variations_switches.h"
Expand Down Expand Up @@ -212,6 +213,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) {
#if defined(OS_WIN)
features::kWinrtGeolocationImplementation.name,
#endif
security_state::features::kSafetyTipUI.name,
};

// Disabled features.
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ void ComponentInstaller::Register(ComponentUpdateService* cus,
"eeigpngbgcognadeebkilcpcaedhellh", // Autofill States Data
"gcmjkmgdlgnkkcocmoeiminaijmmjnii", // Subresource Filter Rules
"ggkkehgbnfjpeggfpleeakpidbkibbmn", // Crowd Deny
"jflookgnkcckhobaglndicnbbgbonegd", // Safety Tips
"llkgjffcdpffmhiakmfcdcblohccpfmo", // Origin Trials
"ojhpjlocmbogdgmfpkhlaaeamibhnphh", // Zxcvbn Data Dictionaries
#if defined(OS_ANDROID)
Expand Down

0 comments on commit 0638cfc

Please sign in to comment.