Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: extensions/shell/app/shell_main_delegate.cc

Issue 745093002: AppShell support for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minors Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/shell/app/shell_main_delegate.h ('k') | extensions/shell/app/shell_main_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/shell/app/shell_main_delegate.cc
diff --git a/extensions/shell/app/shell_main_delegate.cc b/extensions/shell/app/shell_main_delegate.cc
index 69f0e6181b661fb1d15aec4b6a4fca096d28abe4..51390f9f95d6aa08ec12828cd28d785ca9543411 100644
--- a/extensions/shell/app/shell_main_delegate.cc
+++ b/extensions/shell/app/shell_main_delegate.cc
@@ -22,6 +22,11 @@
#include "chromeos/chromeos_paths.h"
#endif
+#if defined(OS_MACOSX)
+#include "base/mac/foundation_util.h"
+#include "extensions/shell/app/paths_mac.h"
+#endif
+
#if !defined(DISABLE_NACL)
#include "components/nacl/common/nacl_switches.h"
#if defined(OS_LINUX)
@@ -46,6 +51,21 @@ void InitLogging() {
logging::SetLogItems(true, true, true, true);
}
+// Returns the path to the extensions_shell_and_test.pak file.
+base::FilePath GetResourcesPakFilePath() {
+#if defined(OS_MACOSX)
+ return base::mac::PathForFrameworkBundleResource(
+ CFSTR("extensions_shell_and_test.pak"));
+#else
+ base::FilePath extensions_shell_and_test_pak_path;
+ PathService::Get(base::DIR_MODULE, &extensions_shell_and_test_pak_path);
+ extensions_shell_and_test_pak_path =
+ extensions_shell_and_test_pak_path.AppendASCII(
+ "extensions_shell_and_test.pak");
+ return extensions_shell_and_test_pak_path;
+#endif // OS_MACOSX
+}
+
} // namespace
namespace extensions {
@@ -61,6 +81,12 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
content_client_.reset(CreateContentClient());
SetContentClient(content_client_.get());
+#if defined(OS_MACOSX)
+ OverrideChildProcessFilePath();
+ // This must happen before InitializeResourceBundle.
+ OverrideFrameworkBundlePath();
+#endif
+
#if defined(OS_CHROMEOS)
chromeos::RegisterPathProvider();
#endif
@@ -124,11 +150,8 @@ ShellMainDelegate::CreateShellContentUtilityClient() {
}
void ShellMainDelegate::InitializeResourceBundle() {
- base::FilePath extensions_shell_and_test_pak_path;
- PathService::Get(base::DIR_MODULE, &extensions_shell_and_test_pak_path);
ui::ResourceBundle::InitSharedInstanceWithPakPath(
- extensions_shell_and_test_pak_path.AppendASCII(
- "extensions_shell_and_test.pak"));
+ GetResourcesPakFilePath());
}
// static
« no previous file with comments | « extensions/shell/app/shell_main_delegate.h ('k') | extensions/shell/app/shell_main_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698