electron/brightray/common/main_delegate.cc
Adam Roben b2a79856ef Add InspectableWebContents
This class can be used to create a content::WebContents that can be inspected
by the Chrome Dev Tools. This requires embedding applications to copy
content_shell.pak into their resource bundle.

Right now the dev tools are always docked to the bottom of the view; we don't
yet support undocking or changing the docked side.

Fixes #1.
2013-03-14 09:05:42 -04:00

38 lines
923 B
C++

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#include "common/main_delegate.h"
#include "browser/browser_client.h"
#include "common/content_client.h"
#include "base/command_line.h"
#include "content/public/common/content_switches.h"
namespace brightray {
MainDelegate::MainDelegate()
: content_client_(new ContentClient) {
}
MainDelegate::~MainDelegate() {
}
bool MainDelegate::BasicStartupComplete(int* exit_code) {
SetContentClient(content_client_.get());
return false;
}
void MainDelegate::PreSandboxStartup() {
// FIXME: We don't currently support running sandboxed.
CommandLine::ForCurrentProcess()->AppendSwitch(switches::kNoSandbox);
#if defined(OS_MACOSX)
OverrideChildProcessPath();
OverrideFrameworkBundlePath();
#endif
InitializeResourceBundle();
}
}