Commit 1165a210 by André Magalhães Committed by Gustavo Noronha

MUS support

To test use 'cefsimple --mus --use-views --url=<url>'

Note that the CEF path not using ui::views/aura doesn't work (
see tests/cefsimple/simple_app.cc)
parent f069dca2
......@@ -126,7 +126,8 @@ if (is_win) {
import("//build/config/win/console_app.gni")
import("//build/config/win/manifest.gni")
}
import("//services/catalog/public/tools/catalog.gni")
import("//services/service_manager/public/service_manifest.gni")
#
# Verify required global arguments configured via `gn args`.
......@@ -744,6 +745,7 @@ static_library("libcef_static") {
"//extensions/renderer",
"//extensions/utility",
"//gpu",
"//gpu/config",
"//ipc",
"//media",
"//media/blink",
......@@ -786,6 +788,17 @@ static_library("libcef_static") {
deps += [ "//third_party/widevine/cdm:widevinecdmadapter" ]
}
embedded_mash_service_deps = [
"//chrome/app/mash:chrome_mash_catalog",
"//chrome/app/mash:embedded_services",
"//mash/common",
"//mash/quick_launch/public/interfaces:constants",
"//services/ui/public/interfaces:constants",
"//chrome/app/mash:chrome_mus_catalog"
]
deps += embedded_mash_service_deps
if (is_win) {
sources += gypi_paths2.includes_win + [
"libcef/browser/browser_main_win.cc",
......@@ -1995,3 +2008,131 @@ if (is_mac) {
}
}
}
cef_packaged_services = [ ":cef_manifest" ]
service_manifest("cef_manifest") {
source = "cef_manifest.json"
}
service_manifest("cef_content_packaged_services_manifest_overlay_for_mash") {
source =
"//cef/cef_content_packaged_services_manifest_overlay.json"
packaged_services = cef_packaged_services
}
service_manifest("cef_content_packaged_services_manifest_overlay") {
source =
"//cef/cef_content_packaged_services_manifest_overlay.json"
packaged_services = cef_packaged_services
packaged_services += [ "//services/ui:manifest" ]
}
service_manifest("cef_content_browser_manifest_overlay") {
source = "//cef/cef_content_browser_manifest_overlay.json"
packaged_services = [
"//services/identity:manifest",
"//services/preferences:manifest",
]
}
service_manifest("cef_content_gpu_manifest_overlay") {
source = "//cef/cef_content_gpu_manifest_overlay.json"
}
service_manifest("cef_content_plugin_manifest_overlay") {
source = "//cef/cef_content_plugin_manifest_overlay.json"
}
service_manifest("cef_content_renderer_manifest_overlay") {
source = "//cef/cef_content_renderer_manifest_overlay.json"
}
service_manifest("cef_content_utility_manifest_overlay") {
source = "//cef/cef_content_utility_manifest_overlay.json"
}
group("cef_content_manifest_overlays") {
deps = [
":cef_content_browser_manifest_overlay",
":cef_content_gpu_manifest_overlay",
":cef_content_packaged_services_manifest_overlay",
":cef_content_plugin_manifest_overlay",
":cef_content_renderer_manifest_overlay",
":cef_content_utility_manifest_overlay",
]
if (enable_package_mash_services) {
deps += [ ":cef_content_packaged_services_manifest_overlay_for_mash" ]
}
}
if (use_aura) {
service_manifest("cef_content_packaged_services_manifest") {
source_manifest = "//content/public/app:packaged_services_manifest"
overlays = [ ":cef_content_packaged_services_manifest_overlay" ]
}
service_manifest("cef_content_packaged_services_manifest_for_mash") {
source_manifest = "//content/public/app:packaged_services_manifest"
overlays = [ ":cef_content_packaged_services_manifest_overlay_for_mash" ]
}
service_manifest("cef_content_browser_manifest") {
source_manifest = "//content/public/app:browser_manifest"
overlays = [ ":cef_content_browser_manifest_overlay" ]
}
service_manifest("cef_content_gpu_manifest") {
source_manifest = "//content/public/app:gpu_manifest"
overlays = [ ":cef_content_gpu_manifest_overlay" ]
}
service_manifest("cef_content_plugin_manifest") {
source_manifest = "//content/public/app:plugin_manifest"
overlays = [ ":cef_content_plugin_manifest_overlay" ]
}
service_manifest("cef_content_renderer_manifest") {
source_manifest = "//content/public/app:renderer_manifest"
overlays = [ ":cef_content_renderer_manifest_overlay" ]
}
service_manifest("cef_content_utility_manifest") {
source_manifest = "//content/public/app:utility_manifest"
overlays = [ ":cef_content_utility_manifest_overlay" ]
}
group("service_manifests") {
deps = [
":cef_content_browser_manifest",
":cef_content_gpu_manifest",
":cef_content_plugin_manifest",
":cef_content_renderer_manifest",
":cef_content_utility_manifest",
]
if (enable_package_mash_services) {
deps += [ ":cef_content_packaged_services_manifest_for_mash" ]
}
}
cef_embedded_services = [
":cef_content_browser_manifest",
":cef_content_gpu_manifest",
":cef_content_plugin_manifest",
":cef_content_renderer_manifest",
":cef_content_utility_manifest",
]
catalog("catalog") {
embedded_services = cef_embedded_services +
[ ":cef_content_packaged_services_manifest" ]
}
catalog("catalog_for_mash") {
embedded_services =
cef_embedded_services +
[ ":cef_content_packaged_services_manifest_for_mash" ]
}
}
{
"name": "content_browser",
"display_name": "CEF",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"renderer": [
"autofill::mojom::AutofillDriver",
"autofill::mojom::PasswordManagerDriver",
"blink::mojom::BudgetService",
"extensions::StashService",
"metrics::mojom::LeakDetector",
"mojom::ModuleEventSink",
"rappor::mojom::RapporRecorder",
"safe_browsing::mojom::SafeBrowsing",
"spellcheck::mojom::SpellCheckHost",
"spellcheck::mojom::SpellCheckPanelHost",
"translate::mojom::ContentTranslateDriver"
],
"url_keyed_metrics": [
"ukm::mojom::UkmRecorderInterface"
],
"gpu": [
"metrics::mojom::CallStackProfileCollector"
],
"ime:ime_driver": [],
"memlog_client": [
"profiling::mojom::MemlogClient"
]
},
"requires": {
"accessibility_autoclick": [ "ash:autoclick" ],
"ash": [ "ash", "display" ],
// Only used in classic ash case.
"ash_pref_connector": [ "pref_connector" ],
// Only used in classic ash case.
"content_browser": [ "memlog_client" ],
"device": [ "device:fingerprint" ],
"identity": [ "identity_manager" ],
"nacl_broker": [ "browser" ],
"nacl_loader": [ "browser" ],
"profiling": [ "memlog" ],
"preferences": [ "pref_client", "pref_control" ],
"ui": [
"display_controller",
"external_window_tree_factory",
"ime_registrar",
"input_device_controller",
"window_manager",
"window_tree_host_factory_registrar"
]
}
},
"navigation:frame": {
"provides": {
"renderer": [
"autofill::mojom::AutofillDriver",
"autofill::mojom::PasswordManagerDriver",
"blink::mojom::BudgetService",
"blink::mojom::InstalledAppProvider",
"blink::mojom::MediaDownloadInProductHelp",
"blink::mojom::ShareService",
"blink::mojom::TextSuggestionHost",
"bluetooth::mojom::AdapterFactory",
"contextual_search::mojom::ContextualSearchJsApiService",
"device::mojom::UsbChooserService",
"device::mojom::UsbDeviceManager",
"dom_distiller::mojom::DistillabilityService",
"dom_distiller::mojom::DistillerJavaScriptService",
"extensions::KeepAlive",
"extensions::mime_handler::MimeHandlerService",
"extensions::mojom::InlineInstall",
"media_router::mojom::MediaRouter",
"page_load_metrics::mojom::PageLoadMetrics",
"password_manager::mojom::CredentialManager",
"translate::mojom::ContentTranslateDriver",
// TODO(beng): These should be moved to a separate capability.
"media::mojom::MediaEngagementScoreDetailsProvider",
"mojom::OmniboxPageHandler",
"mojom::PluginsPageHandler",
"mojom::SiteEngagementDetailsProvider",
"mojom::UsbInternalsPageHandler"
]
}
}
}
}
{
"name": "content_gpu",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"browser": [
"arc::mojom::VideoDecodeAccelerator",
"arc::mojom::VideoDecodeClient",
"arc::mojom::VideoEncodeAccelerator",
"arc::mojom::VideoEncodeClient",
"profiling::mojom::MemlogClient"
]
}
}
}
}
{
"name": "content_packaged_services",
"display_name": "CEF Packaged Services",
"interface_provider_specs": {}
}
{
"name": "content_plugin",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"browser": [
]
}
}
}
}
{
"display_name": "CEF Render Process",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"browser": [
"spellcheck::mojom::SpellChecker",
"profiling::mojom::MemlogClient"
]
},
"requires": {
}
},
"navigation:frame": {
"provides": {
"browser": [
"autofill::mojom::AutofillAgent",
"autofill::mojom::PasswordAutofillAgent",
"autofill::mojom::PasswordGenerationAgent",
"blink::mojom::document_metadata::CopylessPaste",
"contextual_search::mojom::OverlayPageNotifierService",
"dom_distiller::mojom::DistillerPageNotifierService",
"spellcheck::mojom::SpellCheckPanel"
]
}
}
}
}
{
"name": "content_utility",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"browser": [
"extensions::mojom::ExtensionUnpacker",
"extensions::mojom::ManifestParser",
"extensions::mojom::MediaParser",
"extensions::mojom::RemovableStorageWriter",
"extensions::mojom::WiFiCredentialsGetter",
"net::interfaces::ProxyResolverFactory",
"payments::mojom::PaymentManifestParser",
"profiling::mojom::MemlogClient",
"safe_json::mojom::SafeJsonParser"
]
}
}
}
}
{
"name": "CEF",
"display_name": "CEF",
"interface_provider_specs": {
"service_manager:connector": {
"provides": {
"mash:launchable": [
"mash::mojom::Launchable"
],
"renderer": [
"startup_metric_utils::mojom::StartupMetricHost"
]
},
"requires": {
"service_manager": [
"service_manager:all_users"
]
}
}
}
}
......@@ -44,9 +44,9 @@ typedef struct _XDisplay XDisplay;
// Handle types.
#if defined(USE_AURA)
#define cef_cursor_handle_t void*
#define cef_event_handle_t XEvent*
#define cef_window_handle_t unsigned long
#elif
#define cef_event_handle_t void*
#define cef_window_handle_t int
#else
#define cef_cursor_handle_t unsigned long
#define cef_event_handle_t XEvent*
#define cef_window_handle_t unsigned long
......
......@@ -41,8 +41,13 @@
#include "ui/base/resource/resource_bundle.h"
#if defined(USE_AURA)
#include "content/public/browser/browser_thread.h"
#include "content/public/common/service_manager_connection.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/runner/common/client_util.h"
#include "ui/aura/env.h"
#include "ui/display/screen.h"
#include "ui/views/mus/mus_client.h"
#include "ui/views/test/desktop_test_views_delegate.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#include "ui/wm/core/wm_state.h"
......@@ -224,3 +229,21 @@ void CefBrowserMainParts::PostDestroyThreads() {
delete views::ViewsDelegate::GetInstance();
#endif
}
void CefBrowserMainParts::ServiceManagerConnectionStarted(
content::ServiceManagerConnection* connection) {
DCHECK(connection);
#if defined(USE_AURA)
if (aura::Env::GetInstance()->mode() == aura::Env::Mode::LOCAL)
return;
// WMState is owned as a member, so don't have MusClient create it.
const bool create_wm_state = false;
mus_client_ = base::MakeUnique<views::MusClient>(
connection->GetConnector(), service_manager::Identity(),
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::IO),
create_wm_state);
#endif // defined(USE_AURA)
}
......@@ -31,6 +31,9 @@ class ExtensionsClient;
} // namespace extensions
#if defined(USE_AURA)
namespace views {
class MusClient;
}
namespace wm {
class WMState;
}
......@@ -51,6 +54,8 @@ class CefBrowserMainParts : public content::BrowserMainParts {
void PreMainMessageLoopRun() override;
void PostMainMessageLoopRun() override;
void PostDestroyThreads() override;
void ServiceManagerConnectionStarted(
content::ServiceManagerConnection* connection) override;
CefRefPtr<CefRequestContextImpl> request_context() const {
return global_request_context_;
......@@ -72,6 +77,7 @@ class CefBrowserMainParts : public content::BrowserMainParts {
#if defined(USE_AURA)
std::unique_ptr<wm::WMState> wm_state_;
std::unique_ptr<views::MusClient> mus_client_;
#endif
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts);
......
......@@ -43,6 +43,7 @@
#include "base/json/json_reader.h"
#include "base/path_service.h"
#include "cef/grit/cef_resources.h"
#include "chrome/browser/embedded_ui_service_info_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/spellchecker/spell_check_host_impl.h"
#include "chrome/common/chrome_switches.h"
......@@ -81,6 +82,9 @@
#include "extensions/common/switches.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "services/ui/common/image_cursors_set.h"
#include "services/ui/public/interfaces/constants.mojom.h"
#include "services/ui/service.h"
#include "storage/browser/quota/quota_settings.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/resource/resource_bundle.h"
......@@ -107,6 +111,13 @@
#include "sandbox/win/src/sandbox_policy.h"
#endif
#if defined(USE_AURA)
#include "services/service_manager/runner/common/client_util.h"
#include "services/ui/public/cpp/gpu/gpu.h"
#include "ui/aura/mus/window_tree_client.h"
#include "ui/views/mus/mus_client.h"
#endif
namespace {
class CefQuotaCallbackImpl : public CefRequestCallback {
......@@ -603,12 +614,27 @@ void CefContentBrowserClient::RegisterOutOfProcessServices(
std::unique_ptr<base::Value> CefContentBrowserClient::GetServiceManifestOverlay(
base::StringPiece name) {
int id = -1;
/*
if (name == content::mojom::kBrowserServiceName)
id = IDR_CEF_BROWSER_MANIFEST_OVERLAY;
else if (name == content::mojom::kRendererServiceName)
id = IDR_CEF_RENDERER_MANIFEST_OVERLAY;
else if (name == content::mojom::kUtilityServiceName)
id = IDR_CEF_UTILITY_MANIFEST_OVERLAY;
*/
if (name == content::mojom::kBrowserServiceName)
id = IDR_CEF_CONTENT_BROWSER_MANIFEST_OVERLAY;
else if (name == content::mojom::kGpuServiceName)
id = IDR_CEF_CONTENT_GPU_MANIFEST_OVERLAY;
else if (name == content::mojom::kPackagedServicesServiceName)
id = IDR_CEF_CONTENT_PACKAGED_SERVICES_MANIFEST_OVERLAY;
else if (name == content::mojom::kPluginServiceName)
id = IDR_CEF_CONTENT_PLUGIN_MANIFEST_OVERLAY;
else if (name == content::mojom::kRendererServiceName)
id = IDR_CEF_CONTENT_RENDERER_MANIFEST_OVERLAY;
else if (name == content::mojom::kUtilityServiceName)
id = IDR_CEF_CONTENT_UTILITY_MANIFEST_OVERLAY;
if (id == -1)
return nullptr;
......@@ -893,6 +919,16 @@ void CefContentBrowserClient::DidCreatePpapiPlugin(
new CefBrowserPepperHostFactory(browser_host)));
}
gpu::GpuChannelEstablishFactory*
CefContentBrowserClient::GetGpuChannelEstablishFactory() {
#if defined(USE_AURA)
if (views::MusClient::Exists()) {
return views::MusClient::Get()->window_tree_client()->gpu();
}
#endif
return nullptr;
}
content::DevToolsManagerDelegate*
CefContentBrowserClient::GetDevToolsManagerDelegate() {
return new CefDevToolsManagerDelegate();
......@@ -992,6 +1028,14 @@ void CefContentBrowserClient::ExposeInterfacesToRenderer(
}
}
void CefContentBrowserClient::RegisterInProcessServices(
StaticServiceMap* services) {
image_cursors_set_ = base::MakeUnique<ui::ImageCursorsSet>();
service_manager::EmbeddedServiceInfo info =
CreateEmbeddedUIServiceInfo(image_cursors_set_->GetWeakPtr());
services->insert(std::make_pair(ui::mojom::kServiceName, info));
}
void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) {
// Register as a Web-safe scheme so that requests for the scheme from a
// render process will be allowed in resource_dispatcher_host_impl.cc
......
......@@ -32,6 +32,10 @@ namespace extensions {
class Extension;
}
namespace ui {
class ImageCursorsSet;
}
class CefContentBrowserClient : public content::ContentBrowserClient {
public:
CefContentBrowserClient();
......@@ -98,6 +102,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override;
std::string GetDefaultDownloadName() override;
void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override;
gpu::GpuChannelEstablishFactory* GetGpuChannelEstablishFactory() override;
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
std::vector<std::unique_ptr<content::NavigationThrottle>>
CreateThrottlesForNavigation(
......@@ -120,6 +125,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* render_process_host) override;
void RegisterInProcessServices(StaticServiceMap* services) override;
// Perform browser process registration for the custom scheme.
void RegisterCustomScheme(const std::string& scheme);
......@@ -131,6 +138,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
const extensions::Extension* GetExtension(
content::SiteInstance* site_instance);
std::unique_ptr<ui::ImageCursorsSet> image_cursors_set_;
CefBrowserMainParts* browser_main_parts_;
std::unique_ptr<content::PluginServiceFilter> plugin_service_filter_;
......
......@@ -30,6 +30,8 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "services/service_manager/embedder/main.h"
#include "services/service_manager/runner/common/client_util.h"
#include "services/service_manager/runner/common/switches.h"
#include "ui/base/ui_base_switches.h"
#if defined(OS_WIN)
......@@ -160,27 +162,22 @@ int CefExecuteProcess(const CefMainArgs& args,
InitCrashReporter();
#endif
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
#if defined(OS_WIN)
command_line.ParseFromString(::GetCommandLineW());
#else
command_line.InitFromArgv(args.argc, args.argv);
#endif
base::CommandLine::Init(args.argc, args.argv);
const base::CommandLine* command_line(base::CommandLine::ForCurrentProcess());
// Wait for the debugger as early in process initialization as possible.
if (command_line.HasSwitch(switches::kWaitForDebugger))
if (command_line->HasSwitch(switches::kWaitForDebugger))
base::debug::WaitForDebugger(60, true);
// If no process type is specified then it represents the browser process and
// we do nothing.
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
command_line->GetSwitchValueASCII(switches::kProcessType);
if (process_type.empty())
return -1;
#if defined(OS_MACOSX) || defined(OS_WIN)
if (process_type == crash_reporter::switches::kCrashpadHandler)
return RunAsCrashpadHandler(command_line);
return RunAsCrashpadHandler(*command_line);
#endif
CefMainDelegate main_delegate(application);
......@@ -204,6 +201,11 @@ int CefExecuteProcess(const CefMainArgs& args,
params.argc = args.argc;
params.argv = const_cast<const char**>(args.argv);
#if defined(USE_AURA)
if (command_line->HasSwitch("mus"))
params.env_mode = aura::Env::Mode::MUS;
#endif
return content::ContentMain(params);
#endif
}
......@@ -376,6 +378,13 @@ bool CefContext::Initialize(const CefMainArgs& args,
params.argv = const_cast<const char**>(args.argv);
#endif
auto command_line = base::CommandLine::ForCurrentProcess();
#if defined(USE_AURA)
if (command_line->HasSwitch("mus"))
params.env_mode = aura::Env::Mode::MUS;
#endif
sm_main_delegate_.reset(
new content::ContentServiceManagerMainDelegate(params));
sm_main_params_.reset(
......
......@@ -82,6 +82,12 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
window_x11_ = new CefWindowX11(browser_, window_info_.parent_window, rect);
window_info_.window = window_x11_->xwindow();
StubPlatformWindowDelegate window_delegate_;
window_ = ui::OzonePlatform::GetInstance()->CreatePlatformWindow(&window_delegate_, rect);
window_info_.window = window_delegate_.widget();
*/
host_window_created_ = true;
// Add a reference that will be released in BrowserDestroyed().
......
......@@ -11,6 +11,7 @@
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/native_frame_view.h"
#include "ui/views/window/custom_frame_view.h"
#if defined(OS_WIN)
#include "ui/display/screen.h"
......@@ -382,9 +383,19 @@ views::NonClientFrameView* CefWindowView::CreateNonClientFrameView(
// NativeFrameView by default. Extend that type.
return new NativeFrameViewEx(widget, this);
} else {
// FIXME(andrunko): here it creates a window with decoration but input doesn't work
//views::CustomFrameView* custom_frame_view = new views::CustomFrameView;
//custom_frame_view->Init(widget);
//return custom_frame_view;
// FIXME(andrunko): let's return NULL so that the default for this platform
// is created
// For /mus/ the default doesn't support window decoration - specialize it
// to support window decoration
// Widget::CreateNonClientFrameView() returns CustomFrameView by default.
// Need to extend CustomFrameView on this platform.
NOTREACHED() << "Platform does not use NativeFrameView";
//NOTREACHED() << "Platform does not use NativeFrameView";
}
return nullptr;
......
......@@ -31,9 +31,11 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/service_names.mojom.h"
#include "extensions/common/constants.h"
#include "ipc/ipc_features.h"
#include "pdf/pdf.h"
#include "services/service_manager/embedder/switches.h"
#include "ui/base/layout.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
......@@ -65,6 +67,15 @@
#include "base/nix/xdg_util.h"
#endif
#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
#include "chrome/app/mash/chrome_mash_catalog.h"
#include "chrome/app/mash/embedded_services.h"
#include "mash/common/config.h" // nogncheck
#include "mash/quick_launch/public/interfaces/constants.mojom.h" // nogncheck
#include "services/ui/public/interfaces/constants.mojom.h" // nogncheck
#include "chrome/app/mash/chrome_mus_catalog.h"
#endif
namespace {
#if defined(OS_MACOSX)
......@@ -493,6 +504,51 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
return false;
}
service_manager::ProcessType CefMainDelegate::OverrideProcessType() {
const auto& command_line = *base::CommandLine::ForCurrentProcess();
if (command_line.GetSwitchValueASCII(switches::kProcessType) ==
service_manager::switches::kProcessTypeService) {
// Don't mess with embedded service command lines.
return service_manager::ProcessType::kDefault;
}
#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
if (command_line.HasSwitch(switches::kMash)) {
return service_manager::ProcessType::kServiceManager;
}
#endif
return service_manager::ProcessType::kDefault;
}
std::unique_ptr<base::Value> CefMainDelegate::CreateServiceCatalog() {
#if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
const auto& command_line = *base::CommandLine::ForCurrentProcess();
#if defined(OS_CHROMEOS) || defined(OS_LINUX)
if (command_line.HasSwitch(switches::kMus))
return CreateChromeMusCatalog();
#endif // defined(OS_CHROMEOS)
if (command_line.HasSwitch(switches::kMash))
return CreateChromeMashCatalog();
#endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
return nullptr;
}
void CefMainDelegate::AdjustServiceProcessCommandLine(
const service_manager::Identity& identity,
base