Initialize resource bundle on browser process separately
This commit is contained in:
parent
5f6a8a7c24
commit
ec4c5e58ff
4 changed files with 5 additions and 24 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "chrome/common/chrome_paths.h"
|
#include "chrome/common/chrome_paths.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
@ -137,16 +138,4 @@ scoped_ptr<brightray::ContentClient> AtomMainDelegate::CreateContentClient() {
|
||||||
return scoped_ptr<brightray::ContentClient>(new AtomContentClient).Pass();
|
return scoped_ptr<brightray::ContentClient>(new AtomContentClient).Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomMainDelegate::AddDataPackFromPath(
|
|
||||||
ui::ResourceBundle* bundle, const base::FilePath& pak_dir) {
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
bundle->AddDataPackFromPath(
|
|
||||||
pak_dir.Append(FILE_PATH_LITERAL("ui_resources_200_percent.pak")),
|
|
||||||
ui::SCALE_FACTOR_200P);
|
|
||||||
bundle->AddDataPackFromPath(
|
|
||||||
pak_dir.Append(FILE_PATH_LITERAL("content_resources_200_percent.pak")),
|
|
||||||
ui::SCALE_FACTOR_200P);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -25,8 +25,6 @@ class AtomMainDelegate : public brightray::MainDelegate {
|
||||||
|
|
||||||
// brightray::MainDelegate:
|
// brightray::MainDelegate:
|
||||||
scoped_ptr<brightray::ContentClient> CreateContentClient() override;
|
scoped_ptr<brightray::ContentClient> CreateContentClient() override;
|
||||||
void AddDataPackFromPath(
|
|
||||||
ui::ResourceBundle* bundle, const base::FilePath& pak_dir) override;
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
void OverrideChildProcessPath() override;
|
void OverrideChildProcessPath() override;
|
||||||
void OverrideFrameworkBundlePath() override;
|
void OverrideFrameworkBundlePath() override;
|
||||||
|
|
|
@ -13,20 +13,14 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
void AtomBrowserMainParts::PreMainMessageLoopStart() {
|
void AtomBrowserMainParts::PreMainMessageLoopStart() {
|
||||||
// Initialize locale setting.
|
|
||||||
l10n_util::OverrideLocaleWithCocoaLocale();
|
|
||||||
|
|
||||||
// Force the NSApplication subclass to be used.
|
// Force the NSApplication subclass to be used.
|
||||||
NSApplication* application = [AtomApplication sharedApplication];
|
[AtomApplication sharedApplication];
|
||||||
|
|
||||||
|
// Set our own application delegate.
|
||||||
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
|
AtomApplicationDelegate* delegate = [[AtomApplicationDelegate alloc] init];
|
||||||
[NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
|
[NSApp setDelegate:(id<NSFileManagerDelegate>)delegate];
|
||||||
|
|
||||||
NSBundle* frameworkBundle = base::mac::FrameworkBundle();
|
brightray::BrowserMainParts::PreMainMessageLoopStart();
|
||||||
NSNib* mainNib = [[NSNib alloc] initWithNibNamed:@"MainMenu"
|
|
||||||
bundle:frameworkBundle];
|
|
||||||
[mainNib instantiateWithOwner:application topLevelObjects:nil];
|
|
||||||
[mainNib release];
|
|
||||||
|
|
||||||
// Prevent Cocoa from turning command-line arguments into
|
// Prevent Cocoa from turning command-line arguments into
|
||||||
// |-application:openFiles:|, since we already handle them directly.
|
// |-application:openFiles:|, since we already handle them directly.
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit f9c272ec86ee83915729cf2ecdfdd5aa418b77eb
|
Subproject commit 8550f2a032b332d86bd8a7ec235685e22d028906
|
Loading…
Add table
Add a link
Reference in a new issue