
It is almost always possible to forward declare ProfileManager instead. Then add missing includes or forward declarations to fix the build. Change-Id: Ia5f3f10ec8699b7cc0417b0c16c802b7b7c14866 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192966 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Peter Boström <pbos@chromium.org> Cr-Commit-Position: refs/heads/main@{#1098113}
68 lines
2.4 KiB
C++
68 lines
2.4 KiB
C++
// Copyright 2014 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef CHROME_BROWSER_EXTENSIONS_CHROME_PROCESS_MANAGER_DELEGATE_H_
|
|
#define CHROME_BROWSER_EXTENSIONS_CHROME_PROCESS_MANAGER_DELEGATE_H_
|
|
|
|
#include "base/scoped_multi_source_observation.h"
|
|
#include "base/scoped_observation.h"
|
|
#include "chrome/browser/profiles/profile.h"
|
|
#include "chrome/browser/profiles/profile_manager_observer.h"
|
|
#include "chrome/browser/profiles/profile_observer.h"
|
|
#include "chrome/browser/ui/browser_list_observer.h"
|
|
#include "extensions/browser/process_manager_delegate.h"
|
|
|
|
class Browser;
|
|
class Profile;
|
|
class ProfileManager;
|
|
|
|
namespace extensions {
|
|
|
|
// Support for ProcessManager. Controls cases where Chrome wishes to disallow
|
|
// extension background pages or defer their creation.
|
|
class ChromeProcessManagerDelegate : public ProcessManagerDelegate,
|
|
public BrowserListObserver,
|
|
public ProfileManagerObserver,
|
|
public ProfileObserver {
|
|
public:
|
|
ChromeProcessManagerDelegate();
|
|
|
|
ChromeProcessManagerDelegate(const ChromeProcessManagerDelegate&) = delete;
|
|
ChromeProcessManagerDelegate& operator=(const ChromeProcessManagerDelegate&) =
|
|
delete;
|
|
|
|
~ChromeProcessManagerDelegate() override;
|
|
|
|
// ProcessManagerDelegate:
|
|
bool AreBackgroundPagesAllowedForContext(
|
|
content::BrowserContext* context) const override;
|
|
bool IsExtensionBackgroundPageAllowed(
|
|
content::BrowserContext* context,
|
|
const Extension& extension) const override;
|
|
bool DeferCreatingStartupBackgroundHosts(
|
|
content::BrowserContext* context) const override;
|
|
|
|
// BrowserListObserver:
|
|
void OnBrowserAdded(Browser* browser) override;
|
|
|
|
// ProfileManagerObserver:
|
|
void OnProfileAdded(Profile* profile) override;
|
|
void OnProfileManagerDestroying() override;
|
|
|
|
// ProfileObserver:
|
|
void OnOffTheRecordProfileCreated(Profile* off_the_record_profile) override;
|
|
void OnProfileWillBeDestroyed(Profile* profile) override;
|
|
|
|
private:
|
|
base::ScopedObservation<ProfileManager, ProfileManagerObserver>
|
|
profile_manager_observation_{this};
|
|
|
|
base::ScopedMultiSourceObservation<Profile, ProfileObserver>
|
|
observed_profiles_{this};
|
|
};
|
|
|
|
} // namespace extensions
|
|
|
|
#endif // CHROME_BROWSER_EXTENSIONS_CHROME_PROCESS_MANAGER_DELEGATE_H_
|