2015-04-30 03:31:17 +00:00
|
|
|
// Copyright (c) 2015 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
#ifndef SHELL_UTILITY_ELECTRON_CONTENT_UTILITY_CLIENT_H_
|
|
|
|
#define SHELL_UTILITY_ELECTRON_CONTENT_UTILITY_CLIENT_H_
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2017-08-23 23:23:27 +00:00
|
|
|
#include <memory>
|
2019-01-10 00:10:39 +00:00
|
|
|
#include <string>
|
2015-04-30 03:31:17 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
|
|
|
#include "content/public/utility/content_utility_client.h"
|
2019-12-11 00:22:35 +00:00
|
|
|
#include "mojo/public/cpp/bindings/binder_map.h"
|
2018-10-13 01:57:04 +00:00
|
|
|
#include "printing/buildflags/buildflags.h"
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2020-07-14 01:13:34 +00:00
|
|
|
namespace printing {
|
|
|
|
class PrintingHandler;
|
|
|
|
}
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
class ElectronContentUtilityClient : public content::ContentUtilityClient {
|
2015-04-30 03:31:17 +00:00
|
|
|
public:
|
2020-02-04 20:19:40 +00:00
|
|
|
ElectronContentUtilityClient();
|
|
|
|
~ElectronContentUtilityClient() override;
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2019-12-11 00:22:35 +00:00
|
|
|
void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;
|
2017-04-05 03:40:43 +00:00
|
|
|
bool OnMessageReceived(const IPC::Message& message) override;
|
2019-08-15 20:50:58 +00:00
|
|
|
mojo::ServiceFactory* GetMainThreadServiceFactory() override;
|
2019-08-02 23:56:46 +00:00
|
|
|
mojo::ServiceFactory* GetIOThreadServiceFactory() override;
|
2019-01-10 00:10:39 +00:00
|
|
|
|
2015-04-30 03:31:17 +00:00
|
|
|
private:
|
2020-07-14 01:13:34 +00:00
|
|
|
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && defined(OS_WIN)
|
2018-10-13 01:57:04 +00:00
|
|
|
std::unique_ptr<printing::PrintingHandler> printing_handler_;
|
2017-02-01 04:56:34 +00:00
|
|
|
#endif
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2019-12-11 00:22:35 +00:00
|
|
|
// True if the utility process runs with elevated privileges.
|
|
|
|
bool utility_process_running_elevated_;
|
2018-10-13 01:57:04 +00:00
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(ElectronContentUtilityClient);
|
2015-04-30 03:31:17 +00:00
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2015-04-30 03:31:17 +00:00
|
|
|
|
2020-02-04 20:19:40 +00:00
|
|
|
#endif // SHELL_UTILITY_ELECTRON_CONTENT_UTILITY_CLIENT_H_
|