#include "base/command_line.h"
#include "base/debug/stack_trace.h"
#include "base/logging.h"
-#include "base/path_service.h"
#include "content/public/common/content_switches.h"
-#include "ui/base/resource/resource_bundle.h"
namespace atom {
base::debug::EnableInProcessStackDumping();
#endif
-#if defined(OS_MACOSX)
- OverrideChildProcessPath();
- OverrideFrameworkBundlePath();
-#endif
-
- SetContentClient(&content_client_);
- return false;
+ return brightray::MainDelegate::BasicStartupComplete(exit_code);
}
void AtomMainDelegate::PreSandboxStartup() {
- InitializeResourceBundle();
+ brightray::MainDelegate::PreSandboxStartup();
CommandLine* command_line = CommandLine::ForCurrentProcess();
std::string process_type = command_line->GetSwitchValueASCII(
command_line->AppendSwitch("atom-shell-switches-end");
}
-void AtomMainDelegate::InitializeResourceBundle() {
- base::FilePath path;
-#if defined(OS_MACOSX)
- path = GetResourcesPakFilePath();
-#else
- base::FilePath pak_dir;
- PathService::Get(base::DIR_MODULE, &pak_dir);
- path = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak"));
-#endif
-
- ui::ResourceBundle::InitSharedInstanceWithPakPath(path);
-}
-
content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(new AtomBrowserClient);
return browser_client_.get();
protected:
virtual bool BasicStartupComplete(int* exit_code) OVERRIDE;
virtual void PreSandboxStartup() OVERRIDE;
- virtual void InitializeResourceBundle();
#if defined(OS_MACOSX)
- virtual base::FilePath GetResourcesPakFilePath();
- virtual void OverrideChildProcessPath();
- virtual void OverrideFrameworkBundlePath();
+ virtual void OverrideChildProcessPath() OVERRIDE;
+ virtual void OverrideFrameworkBundlePath() OVERRIDE;
#endif
private:
#include "atom/app/atom_main_delegate.h"
-#import "base/mac/bundle_locations.h"
-#import "base/mac/foundation_util.h"
-#import "base/mac/mac_util.h"
-#include "base/command_line.h"
+#include "base/mac/bundle_locations.h"
+#include "base/files/file_path.h"
#include "base/path_service.h"
-#include "base/strings/sys_string_conversions.h"
+#include "brightray/common/mac/main_application_bundle.h"
#include "content/public/common/content_paths.h"
-#include "content/public/common/content_switches.h"
-#include "vendor/brightray/common/application_info.h"
-#include "vendor/brightray/common/mac/main_application_bundle.h"
namespace atom {
} // namespace
-base::FilePath AtomMainDelegate::GetResourcesPakFilePath() {
- NSString* path = [base::mac::FrameworkBundle()
- pathForResource:@"content_shell" ofType:@"pak"];
- return base::mac::NSStringToFilePath(path);
-}
-
void AtomMainDelegate::OverrideFrameworkBundlePath() {
base::mac::SetOverrideFrameworkBundlePath(
GetFrameworksPath().Append("Atom Framework.framework"));
-Subproject commit 842b674b6afa26ffc9d3d97f2ff96f0bb8498d74
+Subproject commit c1c4cfcaad43ca4a802e15328a39f574a97fa272