2020-01-13 22:55:58 +00:00
|
|
|
// Copyright (c) 2019 Slack Technologies, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "shell/browser/extensions/electron_extensions_api_client.h"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2020-02-03 22:01:10 +00:00
|
|
|
#include "shell/browser/extensions/electron_extension_web_contents_observer.h"
|
2020-01-13 22:55:58 +00:00
|
|
|
#include "shell/browser/extensions/electron_messaging_delegate.h"
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
|
|
|
|
ElectronExtensionsAPIClient::ElectronExtensionsAPIClient() = default;
|
|
|
|
ElectronExtensionsAPIClient::~ElectronExtensionsAPIClient() = default;
|
|
|
|
|
|
|
|
MessagingDelegate* ElectronExtensionsAPIClient::GetMessagingDelegate() {
|
|
|
|
if (!messaging_delegate_)
|
|
|
|
messaging_delegate_ = std::make_unique<ElectronMessagingDelegate>();
|
|
|
|
return messaging_delegate_.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ElectronExtensionsAPIClient::AttachWebContentsHelpers(
|
|
|
|
content::WebContents* web_contents) const {
|
2020-02-03 22:01:10 +00:00
|
|
|
extensions::ElectronExtensionWebContentsObserver::CreateForWebContents(
|
2020-01-13 22:55:58 +00:00
|
|
|
web_contents);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace extensions
|