Get ready to make relauncher cross-platform

This commit is contained in:
Cheng Zhao 2016-06-01 22:04:20 +09:00
parent abdcb9d481
commit 6df18956cd
6 changed files with 26 additions and 46 deletions

View file

@ -9,6 +9,7 @@
#include "atom/app/atom_content_client.h"
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/relauncher.h"
#include "atom/common/google_api_key.h"
#include "atom/renderer/atom_renderer_client.h"
#include "atom/utility/atom_content_utility_client.h"
@ -21,17 +22,11 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_MACOSX)
#include "chrome/browser/mac/relauncher.h"
#endif
namespace atom {
namespace {
#if defined(OS_MACOSX)
const char* kRelauncherProcess = "relauncher";
#endif
bool IsBrowserProcess(base::CommandLine* cmd) {
std::string process_type = cmd->GetSwitchValueASCII(switches::kProcessType);
@ -154,12 +149,11 @@ content::ContentUtilityClient* AtomMainDelegate::CreateContentUtilityClient() {
return utility_client_.get();
}
#if defined(OS_MACOSX)
int AtomMainDelegate::RunProcess(
const std::string& process_type,
const content::MainFunctionParams& main_function_params) {
if (process_type == kRelauncherProcess)
return mac_relauncher::internal::RelauncherMain(main_function_params);
return relauncher::RelauncherMain(main_function_params);
else
return -1;
}
@ -172,7 +166,6 @@ bool AtomMainDelegate::DelaySandboxInitialization(
const std::string& process_type) {
return process_type == kRelauncherProcess;
}
#endif
std::unique_ptr<brightray::ContentClient>
AtomMainDelegate::CreateContentClient() {