parent
d3a0a2300b
commit
8eb15f7554
6 changed files with 33 additions and 4 deletions
|
@ -35,6 +35,10 @@
|
||||||
#include "atom/common/common_message_generator.h"
|
#include "atom/common/common_message_generator.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
|
#include "atom/app/atom_main_delegate_mac.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -158,6 +162,12 @@ void AtomMainDelegate::PreSandboxStartup() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AtomMainDelegate::PreContentInitialization() {
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
|
RegisterAtomCrApp();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
|
content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
|
||||||
browser_client_.reset(new AtomBrowserClient);
|
browser_client_.reset(new AtomBrowserClient);
|
||||||
return browser_client_.get();
|
return browser_client_.get();
|
||||||
|
|
|
@ -22,6 +22,7 @@ class AtomMainDelegate : public brightray::MainDelegate {
|
||||||
// content::ContentMainDelegate:
|
// content::ContentMainDelegate:
|
||||||
bool BasicStartupComplete(int* exit_code) override;
|
bool BasicStartupComplete(int* exit_code) override;
|
||||||
void PreSandboxStartup() override;
|
void PreSandboxStartup() override;
|
||||||
|
void PreContentInitialization() override;
|
||||||
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
content::ContentBrowserClient* CreateContentBrowserClient() override;
|
||||||
content::ContentRendererClient* CreateContentRendererClient() override;
|
content::ContentRendererClient* CreateContentRendererClient() override;
|
||||||
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
content::ContentUtilityClient* CreateContentUtilityClient() override;
|
||||||
|
|
15
atom/app/atom_main_delegate_mac.h
Normal file
15
atom/app/atom_main_delegate_mac.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2013 Slack Technologies, Inc. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_MAC_H_
|
||||||
|
#define ATOM_APP_ATOM_MAIN_DELEGATE_MAC_H_
|
||||||
|
|
||||||
|
namespace atom {
|
||||||
|
|
||||||
|
// Initializes NSApplication.
|
||||||
|
void RegisterAtomCrApp();
|
||||||
|
|
||||||
|
} // namespace atom
|
||||||
|
|
||||||
|
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_MAC_H_
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "atom/app/atom_main_delegate.h"
|
#include "atom/app/atom_main_delegate.h"
|
||||||
|
|
||||||
|
#include "atom/browser/mac/atom_application.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
#include "base/files/file_util.h"
|
#include "base/files/file_util.h"
|
||||||
#include "base/mac/bundle_locations.h"
|
#include "base/mac/bundle_locations.h"
|
||||||
|
@ -63,4 +64,9 @@ void AtomMainDelegate::SetUpBundleOverrides() {
|
||||||
base::mac::SetBaseBundleID(base_bundle_id.c_str());
|
base::mac::SetBaseBundleID(base_bundle_id.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterAtomCrApp() {
|
||||||
|
// Force the NSApplication subclass to be used.
|
||||||
|
[AtomApplication sharedApplication];
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#include "atom/browser/atom_browser_main_parts.h"
|
#include "atom/browser/atom_browser_main_parts.h"
|
||||||
|
|
||||||
#include "atom/browser/mac/atom_application.h"
|
|
||||||
#include "atom/browser/mac/atom_application_delegate.h"
|
#include "atom/browser/mac/atom_application_delegate.h"
|
||||||
#include "base/mac/bundle_locations.h"
|
#include "base/mac/bundle_locations.h"
|
||||||
#include "base/mac/foundation_util.h"
|
#include "base/mac/foundation_util.h"
|
||||||
|
@ -13,9 +12,6 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
void AtomBrowserMainParts::PreMainMessageLoopStart() {
|
void AtomBrowserMainParts::PreMainMessageLoopStart() {
|
||||||
// Force the NSApplication subclass to be used.
|
|
||||||
[AtomApplication sharedApplication];
|
|
||||||
|
|
||||||
// Set our own application delegate.
|
// Set our own application delegate.
|
||||||
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
|
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
|
||||||
[NSApp setDelegate:delegate];
|
[NSApp setDelegate:delegate];
|
||||||
|
|
|
@ -112,6 +112,7 @@ filenames = {
|
||||||
"atom/app/atom_content_client.h",
|
"atom/app/atom_content_client.h",
|
||||||
"atom/app/atom_main_delegate.cc",
|
"atom/app/atom_main_delegate.cc",
|
||||||
"atom/app/atom_main_delegate.h",
|
"atom/app/atom_main_delegate.h",
|
||||||
|
"atom/app/atom_main_delegate_mac.h",
|
||||||
"atom/app/atom_main_delegate_mac.mm",
|
"atom/app/atom_main_delegate_mac.mm",
|
||||||
"atom/app/command_line_args.cc",
|
"atom/app/command_line_args.cc",
|
||||||
"atom/app/command_line_args.h",
|
"atom/app/command_line_args.h",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue