Adapt to new signature of ChromeBrowserMainParts::PostProfileInit()
Chromium change: https://source.chromium.org/chromium/chromium/src/+/81c4a83ef015320c58c3f07be94c3bb686da31e9 commit 81c4a83ef015320c58c3f07be94c3bb686da31e9 Author: Nicolas Dossou-Gbete <dgn@chromium.org> Date: Wed Jan 12 19:01:14 2022 +0000 Pass profile as arg to `PostProfileInit` This is a no-op refactor to change the method's signature and remove the `ChromeBrowserMainParts::profile()` getter. It is done in preparation for changes to call `PostProfileInit` after each profile's creation. Bug: 1150326
This commit is contained in:
committed by
mkarolin
parent
d91d8b0ac7
commit
969249cd90
@@ -128,20 +128,21 @@ void BraveBrowserMainParts::PostBrowserStart() {
|
||||
active_web_contents = browser->tab_strip_model()->GetActiveWebContents();
|
||||
|
||||
if (active_web_contents) {
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(active_web_contents->GetBrowserContext());
|
||||
infobars::ContentInfoBarManager* infobar_manager =
|
||||
infobars::ContentInfoBarManager::FromWebContents(active_web_contents);
|
||||
|
||||
if (infobar_manager) {
|
||||
if (profile && infobar_manager) {
|
||||
BraveConfirmP3AInfoBarDelegate::Create(
|
||||
infobar_manager, g_browser_process->local_state());
|
||||
auto* sync_service = SyncServiceFactory::IsSyncAllowed(profile())
|
||||
? SyncServiceFactory::GetForProfile(profile())
|
||||
auto* sync_service = SyncServiceFactory::IsSyncAllowed(profile)
|
||||
? SyncServiceFactory::GetForProfile(profile)
|
||||
: nullptr;
|
||||
const bool is_v2_user =
|
||||
sync_service &&
|
||||
sync_service->GetUserSettings()->IsFirstSetupComplete();
|
||||
SyncV2MigrateInfoBarDelegate::Create(infobar_manager, is_v2_user,
|
||||
profile(), browser);
|
||||
profile, browser);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,11 +172,12 @@ void BraveBrowserMainParts::PreProfileInit() {
|
||||
translate::TranslateLanguageList::DisableUpdate();
|
||||
}
|
||||
|
||||
void BraveBrowserMainParts::PostProfileInit() {
|
||||
ChromeBrowserMainParts::PostProfileInit();
|
||||
void BraveBrowserMainParts::PostProfileInit(Profile* profile,
|
||||
bool is_initial_profile) {
|
||||
ChromeBrowserMainParts::PostProfileInit(profile, is_initial_profile);
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
if (profile()->GetPrefs()->GetBoolean(kBackgroundVideoPlaybackEnabled)) {
|
||||
if (profile->GetPrefs()->GetBoolean(kBackgroundVideoPlaybackEnabled)) {
|
||||
content::RenderFrameHost::AllowInjectingJavaScript();
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
command_line->AppendSwitch(switches::kDisableBackgroundMediaSuspend);
|
||||
@@ -184,7 +186,7 @@ void BraveBrowserMainParts::PostProfileInit() {
|
||||
|
||||
#if BUILDFLAG(ETHEREUM_REMOTE_CLIENT_ENABLED) && BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
extensions::ExtensionService* service =
|
||||
extensions::ExtensionSystem::Get(profile())->extension_service();
|
||||
extensions::ExtensionSystem::Get(profile)->extension_service();
|
||||
if (service) {
|
||||
extensions::ComponentLoader* loader = service->component_loader();
|
||||
static_cast<extensions::BraveComponentLoader*>(loader)
|
||||
|
||||
@@ -20,7 +20,7 @@ class BraveBrowserMainParts : public ChromeBrowserMainParts {
|
||||
void PostBrowserStart() override;
|
||||
void PreShutdown() override;
|
||||
void PreProfileInit() override;
|
||||
void PostProfileInit() override;
|
||||
void PostProfileInit(Profile* profile, bool is_initial_profile) override;
|
||||
|
||||
private:
|
||||
friend class ChromeBrowserMainExtraPartsTor;
|
||||
|
||||
Reference in New Issue
Block a user