#include "extensions/browser/api/extensions_api_client.h"
#include "build/build_config.h"
#include "extensions/browser/api/device_permissions_prompt.h"
#include "extensions/browser/api/system_display/display_info_provider.h"
#include "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_delegate.h"
#include "extensions/browser/supervised_user_extensions_delegate.h"
#if BUILDFLAG(ENABLE_GUEST_VIEW)
#include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h"
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h"
#include "extensions/browser/guest_view/web_view/web_view_permission_helper_delegate.h"
#endif
namespace extensions {
class AppViewGuestDelegate;
namespace {
ExtensionsAPIClient* g_instance = …;
}
ExtensionsAPIClient::ExtensionsAPIClient() { … }
ExtensionsAPIClient::~ExtensionsAPIClient() { … }
ExtensionsAPIClient* ExtensionsAPIClient::Get() { … }
void ExtensionsAPIClient::AddAdditionalValueStoreCaches(
content::BrowserContext* context,
const scoped_refptr<value_store::ValueStoreFactory>& factory,
SettingsChangedCallback observer,
std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { … }
void ExtensionsAPIClient::AttachWebContentsHelpers(
content::WebContents* web_contents) const { … }
bool ExtensionsAPIClient::ShouldHideResponseHeader(
const GURL& url,
const std::string& header_name) const { … }
bool ExtensionsAPIClient::ShouldHideBrowserNetworkRequest(
content::BrowserContext* context,
const WebRequestInfo& request) const { … }
void ExtensionsAPIClient::NotifyWebRequestWithheld(
int render_process_id,
int render_frame_id,
const ExtensionId& extension_id) { … }
void ExtensionsAPIClient::UpdateActionCount(content::BrowserContext* context,
const ExtensionId& extension_id,
int tab_id,
int action_count,
bool clear_badge_text) { … }
void ExtensionsAPIClient::ClearActionCount(content::BrowserContext* context,
const Extension& extension) { … }
void ExtensionsAPIClient::OpenFileUrl(
const GURL& file_url,
content::BrowserContext* browser_context) { … }
#if BUILDFLAG(ENABLE_GUEST_VIEW)
AppViewGuestDelegate* ExtensionsAPIClient::CreateAppViewGuestDelegate() const { … }
ExtensionOptionsGuestDelegate*
ExtensionsAPIClient::CreateExtensionOptionsGuestDelegate(
ExtensionOptionsGuest* guest) const { … }
std::unique_ptr<guest_view::GuestViewManagerDelegate>
ExtensionsAPIClient::CreateGuestViewManagerDelegate() const { … }
std::unique_ptr<MimeHandlerViewGuestDelegate>
ExtensionsAPIClient::CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const { … }
WebViewGuestDelegate* ExtensionsAPIClient::CreateWebViewGuestDelegate(
WebViewGuest* web_view_guest) const { … }
WebViewPermissionHelperDelegate* ExtensionsAPIClient::
CreateWebViewPermissionHelperDelegate(
WebViewPermissionHelper* web_view_permission_helper) const { … }
#endif
#if BUILDFLAG(IS_CHROMEOS)
std::unique_ptr<ConsentProvider> ExtensionsAPIClient::CreateConsentProvider(
content::BrowserContext* browser_context) const {
return nullptr;
}
#endif
scoped_refptr<ContentRulesRegistry>
ExtensionsAPIClient::CreateContentRulesRegistry(
content::BrowserContext* browser_context,
RulesCacheDelegate* cache_delegate) const { … }
std::unique_ptr<DevicePermissionsPrompt>
ExtensionsAPIClient::CreateDevicePermissionsPrompt(
content::WebContents* web_contents) const { … }
#if BUILDFLAG(IS_CHROMEOS)
bool ExtensionsAPIClient::ShouldAllowDetachingUsb(int vid, int pid) const {
return false;
}
#endif
std::unique_ptr<VirtualKeyboardDelegate>
ExtensionsAPIClient::CreateVirtualKeyboardDelegate(
content::BrowserContext* context) const { … }
ManagementAPIDelegate* ExtensionsAPIClient::CreateManagementAPIDelegate()
const { … }
std::unique_ptr<SupervisedUserExtensionsDelegate>
ExtensionsAPIClient::CreateSupervisedUserExtensionsDelegate(
content::BrowserContext* context) const { … }
std::unique_ptr<DisplayInfoProvider>
ExtensionsAPIClient::CreateDisplayInfoProvider() const { … }
MetricsPrivateDelegate* ExtensionsAPIClient::GetMetricsPrivateDelegate() { … }
FileSystemDelegate* ExtensionsAPIClient::GetFileSystemDelegate() { … }
MessagingDelegate* ExtensionsAPIClient::GetMessagingDelegate() { … }
FeedbackPrivateDelegate* ExtensionsAPIClient::GetFeedbackPrivateDelegate() { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
NonNativeFileSystemDelegate*
ExtensionsAPIClient::GetNonNativeFileSystemDelegate() {
return nullptr;
}
MediaPerceptionAPIDelegate*
ExtensionsAPIClient::GetMediaPerceptionAPIDelegate() {
return nullptr;
}
#endif
#if BUILDFLAG(IS_CHROMEOS)
void ExtensionsAPIClient::SaveImageDataToClipboard(
std::vector<uint8_t> image_data,
api::clipboard::ImageType type,
AdditionalDataItemList additional_items,
base::OnceClosure success_callback,
base::OnceCallback<void(const std::string&)> error_callback) {}
#endif
AutomationInternalApiDelegate*
ExtensionsAPIClient::GetAutomationInternalApiDelegate() { … }
std::vector<KeyedServiceBaseFactory*>
ExtensionsAPIClient::GetFactoryDependencies() { … }
}