electron/shell/utility/atom_content_utility_client.h
Electron Bot db21391156 chore: bump chromium to cbeb16cf544f79c1990f1eae4d4fe (master) (#19610)
Co-authored-by: Erick Zhao <erickzhao@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by Micha Hanselmann <DeerMichel@github.com>
2019-08-15 13:50:58 -07:00

50 lines
1.5 KiB
C++

// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef SHELL_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_
#define SHELL_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_
#include <memory>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
#include "content/public/utility/content_utility_client.h"
#include "printing/buildflags/buildflags.h"
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
#include "chrome/utility/printing_handler.h"
#endif
namespace electron {
class AtomContentUtilityClient : public content::ContentUtilityClient {
public:
AtomContentUtilityClient();
~AtomContentUtilityClient() override;
void UtilityThreadStarted() override;
bool OnMessageReceived(const IPC::Message& message) override;
bool HandleServiceRequest(
const std::string& service_name,
service_manager::mojom::ServiceRequest request) override;
mojo::ServiceFactory* GetMainThreadServiceFactory() override;
mojo::ServiceFactory* GetIOThreadServiceFactory() override;
private:
std::unique_ptr<service_manager::Service> MaybeCreateMainThreadService(
const std::string& service_name,
service_manager::mojom::ServiceRequest request);
#if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
std::unique_ptr<printing::PrintingHandler> printing_handler_;
#endif
bool elevated_;
DISALLOW_COPY_AND_ASSIGN(AtomContentUtilityClient);
};
} // namespace electron
#endif // SHELL_UTILITY_ATOM_CONTENT_UTILITY_CLIENT_H_