Skip to content

Commit

Permalink
Remove check_includes = false for //brave/browser/extensions (#25826)
Browse files Browse the repository at this point in the history
Remove brave/extensions check_includes = false
Some new targets with check_includes = false have been created to minimize the amount of code where gn check does not apply.
  • Loading branch information
bridiver authored Oct 5, 2024
1 parent 41ec737 commit 7254c72
Show file tree
Hide file tree
Showing 40 changed files with 447 additions and 207 deletions.
4 changes: 3 additions & 1 deletion browser/autocomplete/brave_autocomplete_scheme_classifier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
#include <string>

#include "base/strings/string_util.h"
#include "brave/components/constants/pref_names.h"
#include "brave/components/constants/url_constants.h"
#include "chrome/browser/profiles/profile.h"
#include "components/prefs/pref_service.h"

#if BUILDFLAG(ENABLE_BRAVE_WEBTORRENT)
#include "brave/components/brave_webtorrent/browser/webtorrent_util.h"
Expand Down Expand Up @@ -40,7 +42,7 @@ BraveAutocompleteSchemeClassifier::GetInputTypeForScheme(

#if BUILDFLAG(ENABLE_BRAVE_WEBTORRENT)
if (base::IsStringASCII(scheme) &&
webtorrent::IsWebtorrentPrefEnabled(profile_->GetPrefs()) &&
profile_->GetPrefs()->GetBoolean(kWebTorrentEnabled) &&
base::EqualsCaseInsensitiveASCII(scheme, kMagnetScheme)) {
return metrics::OmniboxInputType::URL;
}
Expand Down
26 changes: 26 additions & 0 deletions browser/brave_adaptive_captcha/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2024 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/.

source_set("brave_adaptive_captcha") {
sources = [
"brave_adaptive_captcha_service_factory.cc",
"brave_adaptive_captcha_service_factory.h",
]

public_deps = [
"//components/keyed_service/content",
"//content/public/browser",
]

deps = [
"//base",
"//brave/browser/brave_rewards",
"//brave/components/brave_adaptive_captcha",
"//chrome/browser/profiles:profile",
"//chrome/browser/ui",
"//components/keyed_service/content",
"//components/user_prefs",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@

#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#if !BUILDFLAG(IS_ANDROID)
#include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#endif
#include "brave/browser/brave_rewards/rewards_service_factory.h"
#include "brave/components/brave_adaptive_captcha/brave_adaptive_captcha_delegate.h"
#include "brave/components/brave_adaptive_captcha/brave_adaptive_captcha_service.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/storage_partition.h"

#if !BUILDFLAG(IS_ANDROID)
#include "brave/browser/ui/brave_rewards/rewards_panel_coordinator.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#endif

namespace {

class CaptchaDelegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#ifndef BRAVE_BROWSER_BRAVE_ADAPTIVE_CAPTCHA_BRAVE_ADAPTIVE_CAPTCHA_SERVICE_FACTORY_H_
#define BRAVE_BROWSER_BRAVE_ADAPTIVE_CAPTCHA_BRAVE_ADAPTIVE_CAPTCHA_SERVICE_FACTORY_H_

#include "brave/components/brave_adaptive_captcha/brave_adaptive_captcha_delegate.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "content/public/browser/browser_context.h"

class Profile;

Expand Down
20 changes: 0 additions & 20 deletions browser/brave_adaptive_captcha/sources.gni

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "brave/browser/brave_ads/ads_service_factory.h"
#include "brave/browser/ui/brave_ads/notification_ad_delegate.h"
#include "brave/browser/ui/brave_ads/notification_ad_popup_handler.h"
#include "brave/components/brave_ads/browser/ads_service.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
Expand Down
2 changes: 2 additions & 0 deletions browser/brave_ads/ads_service_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
#include "brave/browser/brave_adaptive_captcha/brave_adaptive_captcha_service_factory.h"
#include "brave/browser/brave_ads/device_id/device_id_impl.h"
#include "brave/browser/brave_ads/services/bat_ads_service_factory_impl.h"
#include "brave/browser/brave_ads/tooltips/ads_tooltips_delegate_impl.h"
#include "brave/browser/brave_browser_process.h"
#include "brave/browser/brave_rewards/rewards_service_factory.h"
#include "brave/browser/brave_rewards/rewards_util.h"
#include "brave/components/brave_ads/browser/ads_service.h"
#include "brave/components/brave_ads/browser/ads_service_impl.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/history_service_factory.h"
Expand Down
5 changes: 3 additions & 2 deletions browser/brave_ads/ads_service_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#include <memory>

#include "brave/browser/brave_ads/tooltips/ads_tooltips_delegate_impl.h"
#include "brave/components/brave_ads/browser/ads_service.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"

class Profile;
Expand All @@ -21,6 +19,9 @@ class NoDestructor;

namespace brave_ads {

class AdsService;
class AdsTooltipsDelegateImpl;

// Singleton that owns all AdsService and associates them with Profiles.
class AdsServiceFactory : public BrowserContextKeyedServiceFactory {
public:
Expand Down
1 change: 1 addition & 0 deletions browser/brave_ads/android/brave_ads_native_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/android/jni_string.h"
#include "brave/browser/brave_ads/ads_service_factory.h"
#include "brave/browser/brave_ads/android/jni_headers/BraveAdsNativeHelper_jni.h"
#include "brave/components/brave_ads/browser/ads_service.h"
#include "brave/components/brave_ads/core/public/ads_util.h"
#include "brave/components/brave_ads/core/public/prefs/pref_names.h"
#include "chrome/browser/profiles/profile.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "brave/components/brave_ads/core/public/ads_feature.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_search/common/brave_search_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_isolated_world_ids.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_context.h"
Expand Down
1 change: 1 addition & 0 deletions browser/brave_ads/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ brave_browser_brave_ads_sources = [

brave_browser_brave_ads_deps = [
"//base",
"//brave/browser/brave_adaptive_captcha",
"//brave/browser/brave_ads/device_id",
"//brave/browser/brave_ads/services",
"//brave/browser/brave_rewards:util",
Expand Down
1 change: 1 addition & 0 deletions browser/brave_ads/tabs/ads_tab_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "base/containers/contains.h"
#include "base/strings/stringprintf.h"
#include "brave/browser/brave_ads/ads_service_factory.h"
#include "brave/components/brave_ads/browser/ads_service.h"
#include "brave/components/brave_ads/core/public/prefs/pref_names.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "chrome/browser/profiles/profile.h"
Expand Down
3 changes: 1 addition & 2 deletions browser/brave_wallet/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ source_set("brave_wallet") {
]
if (enable_extensions) {
deps += [
"//brave/browser/extensions",
"//chrome/browser/extensions:extensions",
"//chrome/browser/extensions",
"//extensions/browser",
]
}
Expand Down
5 changes: 5 additions & 0 deletions browser/decentralized_dns/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# You can obtain one at http://mozilla.org/MPL/2.0/. */

import("//brave/build/config.gni")
import("//brave/components/tor/buildflags/buildflags.gni")
import("//testing/test.gni")

source_set("browser_tests") {
Expand Down Expand Up @@ -55,4 +56,8 @@ source_set("unit_tests") {
"//testing/gmock",
"//testing/gtest",
]

if (enable_tor) {
deps += [ "//brave/browser/tor" ]
}
} # source_set("unit_tests")
7 changes: 6 additions & 1 deletion browser/ethereum_remote_client/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 2024 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/.

import("//brave/browser/ethereum_remote_client/buildflags/buildflags.gni")
import("//brave/build/config.gni")
import("//build/config/features.gni")
Expand Down Expand Up @@ -45,7 +50,7 @@ source_set("browser") {
]
deps = [
"//brave/browser/ethereum_remote_client",
"//brave/browser/extensions",
"//brave/browser/extensions:component_loader",
"//chrome/browser/extensions",
"//chrome/browser/profiles",
"//components/keyed_service/content",
Expand Down
Loading

0 comments on commit 7254c72

Please sign in to comment.