From f387535eae6f5d52754e209e817b1e96d413158d Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 11:59:06 -0400 Subject: [PATCH 01/16] Beef up .gitignore --- brightray/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/brightray/.gitignore b/brightray/.gitignore index 4f7257816726..4ee8ba8eacf3 100644 --- a/brightray/.gitignore +++ b/brightray/.gitignore @@ -4,3 +4,6 @@ /brightray.vcxproj* /brightray.xcodeproj/ /build/ + +# Vim +*.swp From 3cf6e5eda22ab5a68ea3cbc80848740249e0ac10 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 12:14:29 -0400 Subject: [PATCH 02/16] Make sure dependents can #include "brightray/foo.h" --- brightray/brightray.gyp | 1 + 1 file changed, 1 insertion(+) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 71f73b98b5c2..48ad90d6beac 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -13,6 +13,7 @@ ], 'direct_dependent_settings': { 'include_dirs': [ + '..', '<(libchromiumcontent_include_dir)', '<(libchromiumcontent_include_dir)/third_party/skia/include/config', ], From 35f4dfe4b0204b77c82f5f65ada60ee001b61e22 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 11:15:04 -0400 Subject: [PATCH 03/16] Add some more default build settings for Windows --- brightray/brightray.gypi | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index bc07c9da1920..965ad51fd6ac 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -6,6 +6,26 @@ 'libchromiumcontent_resources_dir': '<(libchromiumcontent_library_dir)', 'mac_deployment_target%': '10.8', 'mac_sdkroot%': 'macosx', + + 'win_release_RuntimeLibrary%': '0', # /MT (nondebug static) + 'win_debug_RuntimeLibrary%': '1', # /MTd (debug static) + + # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx + 'win_release_Optimization%': '2', # 2 = /Os + 'win_debug_Optimization%': '0', # 0 = /Od + + # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx + # Tri-state: blank is default, 1 on, 0 off + 'win_release_OmitFramePointers%': '0', + # Tri-state: blank is default, 1 on, 0 off + 'win_debug_OmitFramePointers%': '', + + # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx + 'win_debug_RuntimeChecks%': '3', # 3 = all checks enabled, 0 = off + + # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx + 'win_debug_InlineFunctionExpansion%': '', # empty = default, 0 = off, + 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max }, 'target_defaults': { 'defines': [ @@ -43,6 +63,41 @@ 'inherit_from': [ 'Common_Base', ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '<(win_debug_Optimization)', + 'PreprocessorDefinitions': ['_DEBUG'], + 'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)', + # We use Release to match the version of chromiumcontent.dll we + # link against. + 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', + 'conditions': [ + # According to MSVS, InlineFunctionExpansion=0 means + # "default inlining", not "/Ob0". + # Thus, we have to handle InlineFunctionExpansion==0 separately. + ['win_debug_InlineFunctionExpansion==0', { + 'AdditionalOptions': ['/Ob0'], + }], + ['win_debug_InlineFunctionExpansion!=""', { + 'InlineFunctionExpansion': + '<(win_debug_InlineFunctionExpansion)', + }], + # if win_debug_OmitFramePointers is blank, leave as default + ['win_debug_OmitFramePointers==1', { + 'OmitFramePointers': 'true', + }], + ['win_debug_OmitFramePointers==0', { + 'OmitFramePointers': 'false', + # The above is not sufficient (http://crbug.com/106711): it + # simply eliminates an explicit "/Oy", but both /O2 and /Ox + # perform FPO regardless, so we must explicitly disable. + # We still want the false setting above to avoid having + # "/Oy /Oy-" and warnings about overriding. + 'AdditionalOptions': ['/Oy-'], + }], + ], + }, + }, 'xcode_settings': { 'COPY_PHASE_STRIP': 'NO', 'GCC_OPTIMIZATION_LEVEL': '0', @@ -52,6 +107,37 @@ 'inherit_from': [ 'Common_Base', ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '<(win_release_Optimization)', + 'RuntimeLibrary': '<(win_release_RuntimeLibrary)', + 'conditions': [ + # According to MSVS, InlineFunctionExpansion=0 means + # "default inlining", not "/Ob0". + # Thus, we have to handle InlineFunctionExpansion==0 separately. + ['win_release_InlineFunctionExpansion==0', { + 'AdditionalOptions': ['/Ob0'], + }], + ['win_release_InlineFunctionExpansion!=""', { + 'InlineFunctionExpansion': + '<(win_release_InlineFunctionExpansion)', + }], + # if win_release_OmitFramePointers is blank, leave as default + ['win_release_OmitFramePointers==1', { + 'OmitFramePointers': 'true', + }], + ['win_release_OmitFramePointers==0', { + 'OmitFramePointers': 'false', + # The above is not sufficient (http://crbug.com/106711): it + # simply eliminates an explicit "/Oy", but both /O2 and /Ox + # perform FPO regardless, so we must explicitly disable. + # We still want the false setting above to avoid having + # "/Oy /Oy-" and warnings about overriding. + 'AdditionalOptions': ['/Oy-'], + }], + ], + }, + }, }, }, }, From 7b65fe49488080710cee26620eee1c35927144c5 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 13:46:55 -0400 Subject: [PATCH 04/16] Link against chromiumcontent.dll * vendor/libchromiumcontent 4aae27b...15ada44 (3): > Include chromiumcontent.dll's import library > Export sandbox/ headers > Mention that Python is required to build --- brightray/brightray.gyp | 7 +++++++ brightray/vendor/libchromiumcontent | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 48ad90d6beac..92554d1d8bfd 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -70,6 +70,13 @@ ], }, }], + ['OS=="win"', { + 'link_settings': { + 'libraries': [ + '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib', + ], + }, + }], ], }, ], diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index ad588f54dc34..15ada44da42e 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit ad588f54dc342716e55fd23ce69d6e2c176a1df7 +Subproject commit 15ada44da42eec88400ca978fdd73213488a04bc From 4c0765b413fea09ea2d517df2c3ae9d781a53d01 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 14:49:49 -0400 Subject: [PATCH 05/16] Use __declspec(dllimport) for functions from chromiumcontent.dll --- brightray/brightray.gypi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 965ad51fd6ac..8985019011b9 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -28,9 +28,6 @@ 'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max }, 'target_defaults': { - 'defines': [ - 'NDEBUG', - ], 'xcode_settings': { 'ALWAYS_SEARCH_USER_PATHS': 'NO', 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++11', @@ -53,6 +50,14 @@ 'configurations': { 'Common_Base': { 'abstract': 1, + 'defines': [ + 'COMPONENT_BUILD', + 'GURL_DLL', + 'SKIA_DLL', + 'NDEBUG', + 'USING_V8_SHARED', + 'WEBKIT_DLL', + ], 'msvs_configuration_attributes': { 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', From 7f463b896244caa2a87536948f6a7f77a042df6f Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 11:28:44 -0400 Subject: [PATCH 06/16] Give clients access to libchromiumcontent's src directory * vendor/libchromiumcontent 15ada44...65b85bf (2): > Export content/app/startup_helper_win.cc to clients > Rename dist/include to dist/src --- brightray/brightray.gypi | 3 ++- brightray/vendor/libchromiumcontent | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 8985019011b9..3cf7d5000901 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -2,8 +2,9 @@ 'variables': { 'libchromiumcontent_dir': 'vendor/download/libchromiumcontent', 'libchromiumcontent_library_dir': '<(libchromiumcontent_dir)/Release', - 'libchromiumcontent_include_dir': '<(libchromiumcontent_dir)/include', + 'libchromiumcontent_include_dir': '<(libchromiumcontent_dir)/src', 'libchromiumcontent_resources_dir': '<(libchromiumcontent_library_dir)', + 'libchromiumcontent_src_dir': '<(libchromiumcontent_dir)/src', 'mac_deployment_target%': '10.8', 'mac_sdkroot%': 'macosx', diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 15ada44da42e..65b85bf315a9 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 15ada44da42eec88400ca978fdd73213488a04bc +Subproject commit 65b85bf315a9db754a590a6e484f6f705c837583 From 2813bef7411ef1dbf56611160062e1e4226a417b Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 13:48:08 -0400 Subject: [PATCH 07/16] Link against sandbox_static.lib * vendor/libchromiumcontent 15ada44...c973a7c (3): > Create and export sandbox_static.lib for Windows clients > Export content/app/startup_helper_win.cc to clients > Rename dist/include to dist/src --- brightray/brightray.gyp | 1 + brightray/vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 92554d1d8bfd..c1dd0c0e0b2a 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -74,6 +74,7 @@ 'link_settings': { 'libraries': [ '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib', + '<(libchromiumcontent_library_dir)/sandbox_static.lib', ], }, }], diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 65b85bf315a9..c973a7c3937f 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 65b85bf315a9db754a590a6e484f6f705c837583 +Subproject commit c973a7c3937fd31183e2fcf6809dc7182c5fe0ec From 12773cff6ed32e7472764f375e9a33b3eefd967e Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 11:30:43 -0400 Subject: [PATCH 08/16] Fix linker errors about missing registry APIs --- brightray/brightray.gypi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 3cf7d5000901..4d74515ef579 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -64,6 +64,13 @@ 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'CharacterSet': '1', }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'advapi32.lib', + ], + }, + }, }, 'Debug': { 'inherit_from': [ From 12d01e4fd58aee3947f7c49c67319a4a92516ad2 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 11:39:25 -0400 Subject: [PATCH 09/16] ifdef out a bunch of Mac-specific code This is a hacky solution but helps us deal with other compiler/linker errors. --- brightray/browser/browser_client.cc | 2 ++ brightray/browser/inspectable_web_contents_impl.cc | 2 ++ brightray/common/main_delegate.cc | 2 +- brightray/common/main_delegate.h | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 9dc99f18a3b9..72626a5226b2 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -34,8 +34,10 @@ BrowserContext* BrowserClient::browser_context() { } NotificationPresenter* BrowserClient::notification_presenter() { +#if defined(OS_MACOSX) if (!notification_presenter_) notification_presenter_.reset(NotificationPresenter::Create()); +#endif return notification_presenter_.get(); } diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 7f694ad54ff5..c6c6f00f4cd5 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -41,7 +41,9 @@ InspectableWebContentsImpl::InspectableWebContentsImpl(content::WebContents* web auto context = static_cast(web_contents_->GetBrowserContext()); dock_side_ = context->prefs()->GetString(kDockSidePref); +#if defined(OS_MACOSX) view_.reset(CreateInspectableContentsView(this)); +#endif } InspectableWebContentsImpl::~InspectableWebContentsImpl() { diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index 7c1fa903bcb5..09cc8bc10384 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -32,8 +32,8 @@ void MainDelegate::PreSandboxStartup() { #if defined(OS_MACOSX) OverrideChildProcessPath(); OverrideFrameworkBundlePath(); -#endif InitializeResourceBundle(); +#endif } } diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index 34ebfef9d7fe..b695c7c326cd 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -34,8 +34,8 @@ protected: virtual void PreSandboxStartup() OVERRIDE; private: - void InitializeResourceBundle(); #if defined(OS_MACOSX) + void InitializeResourceBundle(); static void OverrideChildProcessPath(); static void OverrideFrameworkBundlePath(); #endif From 7e03f93dcdf5a24257d4b4e3b675ce7bc9959b50 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 11:40:49 -0400 Subject: [PATCH 10/16] Add a stub application_info_win.cc --- brightray/brightray.gyp | 1 + brightray/common/application_info_win.cc | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 brightray/common/application_info_win.cc diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index c1dd0c0e0b2a..8064aeeb1546 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -52,6 +52,7 @@ 'browser/url_request_context_getter.h', 'common/application_info.h', 'common/application_info_mac.mm', + 'common/application_info_win.cc', 'common/content_client.cc', 'common/content_client.h', 'common/mac/foundation_util.h', diff --git a/brightray/common/application_info_win.cc b/brightray/common/application_info_win.cc new file mode 100644 index 000000000000..113330158608 --- /dev/null +++ b/brightray/common/application_info_win.cc @@ -0,0 +1,13 @@ +#include "common/application_info.h" + +namespace brightray { + +std::string GetApplicationName() { + return std::string(); +} + +std::string GetApplicationVersion() { + return std::string(); +} + +} From 6a8ee865f4ceb00cd041666135ffaa69e9f755bd Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 11:42:26 -0400 Subject: [PATCH 11/16] Fix linker errors about missing Win32 APIs --- brightray/brightray.gypi | 1 + 1 file changed, 1 insertion(+) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index 4d74515ef579..e443dde45aa3 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -68,6 +68,7 @@ 'VCLinkerTool': { 'AdditionalDependencies': [ 'advapi32.lib', + 'user32.lib', ], }, }, From 18b64f375cfe4b81b6be08b4206cdfc3df0d0289 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Tue, 21 May 2013 14:49:19 -0400 Subject: [PATCH 12/16] Link client apps against base_static.lib This is required to get base::win::PEImage, which is required by sandboxing code. * vendor/libchromiumcontent c973a7c...04ccdd8 (1): > Export base_static.lib for Windows clients --- brightray/brightray.gyp | 1 + brightray/vendor/libchromiumcontent | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 8064aeeb1546..9676795690e6 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -74,6 +74,7 @@ ['OS=="win"', { 'link_settings': { 'libraries': [ + '<(libchromiumcontent_library_dir)/base_static.lib', '<(libchromiumcontent_library_dir)/chromiumcontent.dll.lib', '<(libchromiumcontent_library_dir)/sandbox_static.lib', ], diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index c973a7c3937f..04ccdd8d3c99 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit c973a7c3937fd31183e2fcf6809dc7182c5fe0ec +Subproject commit 04ccdd8d3c9938eeff3764f77c955ac08553c960 From 1ec7280663cd2db472ae007f0fbcc072e7b6aeef Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 11:16:56 -0400 Subject: [PATCH 13/16] Link against the DLL version of the CRT * vendor/libchromiumcontent 04ccdd8...31efc77 (3): > Use the DLL version of the CRT > Generate libchromiumcontent-symbols.zip on Windows > Fix exporting of WebKit symbols --- brightray/brightray.gypi | 4 ++-- brightray/vendor/libchromiumcontent | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/brightray.gypi b/brightray/brightray.gypi index e443dde45aa3..3f426666d9b1 100644 --- a/brightray/brightray.gypi +++ b/brightray/brightray.gypi @@ -8,8 +8,8 @@ 'mac_deployment_target%': '10.8', 'mac_sdkroot%': 'macosx', - 'win_release_RuntimeLibrary%': '0', # /MT (nondebug static) - 'win_debug_RuntimeLibrary%': '1', # /MTd (debug static) + 'win_release_RuntimeLibrary%': '2', # /MD (nondebug DLL) + 'win_debug_RuntimeLibrary%': '3', # /MTd (debug DLL) # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx 'win_release_Optimization%': '2', # 2 = /Os diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 04ccdd8d3c99..31efc77a0e71 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 04ccdd8d3c9938eeff3764f77c955ac08553c960 +Subproject commit 31efc77a0e71c7dfcf62010fed51ab4acf74fc01 From 3713ea6403be28bb0d345245149a56e9c5a0853d Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 11:37:42 -0400 Subject: [PATCH 14/16] Exclude platform-specific files from other platforms --- brightray/brightray.gyp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 9676795690e6..2732d5c9a1dd 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -70,6 +70,11 @@ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', ], }, + }, { + 'sources/': [ + ['exclude', '/mac/'], + ['exclude', '_mac\.(mm|h)$'], + ], }], ['OS=="win"', { 'link_settings': { @@ -79,6 +84,11 @@ '<(libchromiumcontent_library_dir)/sandbox_static.lib', ], }, + }, { + 'sources/': [ + ['exclude', '/win/'], + ['exclude', '_win\.(cc|h)$'], + ], }], ], }, From f2909b0d90a11c95c8c350107fc5e4e4f5e66549 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 11:40:43 -0400 Subject: [PATCH 15/16] Set up the resource bundle on Windows --- brightray/common/main_delegate.cc | 22 +++++++++++++++++++++- brightray/common/main_delegate.h | 3 ++- brightray/common/main_delegate_mac.mm | 11 ++--------- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/brightray/common/main_delegate.cc b/brightray/common/main_delegate.cc index 09cc8bc10384..5578fc7c3af3 100644 --- a/brightray/common/main_delegate.cc +++ b/brightray/common/main_delegate.cc @@ -8,7 +8,9 @@ #include "common/content_client.h" #include "base/command_line.h" +#include "base/path_service.h" #include "content/public/common/content_switches.h" +#include "ui/base/resource/resource_bundle.h" namespace brightray { @@ -32,8 +34,26 @@ void MainDelegate::PreSandboxStartup() { #if defined(OS_MACOSX) OverrideChildProcessPath(); OverrideFrameworkBundlePath(); - InitializeResourceBundle(); #endif + InitializeResourceBundle(); +} + +void MainDelegate::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); + + std::vector pak_paths; + AddPakPaths(&pak_paths); + for (auto it = pak_paths.begin(), end = pak_paths.end(); it != end; ++it) + ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(*it, ui::SCALE_FACTOR_NONE); } } diff --git a/brightray/common/main_delegate.h b/brightray/common/main_delegate.h index b695c7c326cd..f5cbe88d4e84 100644 --- a/brightray/common/main_delegate.h +++ b/brightray/common/main_delegate.h @@ -34,8 +34,9 @@ protected: virtual void PreSandboxStartup() OVERRIDE; private: -#if defined(OS_MACOSX) void InitializeResourceBundle(); +#if defined(OS_MACOSX) + static base::FilePath GetResourcesPakFilePath(); static void OverrideChildProcessPath(); static void OverrideFrameworkBundlePath(); #endif diff --git a/brightray/common/main_delegate_mac.mm b/brightray/common/main_delegate_mac.mm index 72ae553ff882..aa7bf0f46251 100644 --- a/brightray/common/main_delegate_mac.mm +++ b/brightray/common/main_delegate_mac.mm @@ -12,7 +12,6 @@ #include "base/mac/bundle_locations.h" #include "base/path_service.h" #include "content/public/common/content_paths.h" -#include "ui/base/resource/resource_bundle.h" namespace brightray { @@ -24,15 +23,9 @@ base::FilePath GetFrameworksPath() { } -void MainDelegate::InitializeResourceBundle() { +base::FilePath MainDelegate::GetResourcesPakFilePath() { auto path = [base::mac::FrameworkBundle() pathForResource:@"content_shell" ofType:@"pak"]; - - ui::ResourceBundle::InitSharedInstanceWithPakPath(base::mac::NSStringToFilePath(path)); - - std::vector pak_paths; - AddPakPaths(&pak_paths); - for (const auto& path : pak_paths) - ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(path, ui::SCALE_FACTOR_NONE); + return base::mac::NSStringToFilePath(path); } void MainDelegate::OverrideFrameworkBundlePath() { From d54f4e2bdddff25bca59f5b36870c5bff85a4f6b Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Wed, 22 May 2013 11:48:54 -0400 Subject: [PATCH 16/16] Update libchromiumcontent to get icudt.dll * vendor/libchromiumcontent 31efc77...e436974 (2): > Export icudt.dll for Windows clients > Export libGLESv2.dll on Windows --- brightray/vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 31efc77a0e71..e436974fc1a4 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 31efc77a0e71c7dfcf62010fed51ab4acf74fc01 +Subproject commit e436974fc1a470311879056b93f9bf0c3e2408fc