OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/shell_main_delegate.h" | 5 #include "content/shell/shell_main_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
11 #include "content/public/common/url_constants.h" | 11 #include "content/public/common/url_constants.h" |
12 #include "content/shell/shell_browser_main.h" | 12 #include "content/shell/shell_browser_main.h" |
13 #include "content/shell/shell_content_browser_client.h" | 13 #include "content/shell/shell_content_browser_client.h" |
14 #include "content/shell/shell_content_plugin_client.h" | 14 #include "content/shell/shell_content_plugin_client.h" |
15 #include "content/shell/shell_content_renderer_client.h" | 15 #include "content/shell/shell_content_renderer_client.h" |
16 #include "content/shell/shell_content_utility_client.h" | 16 #include "content/shell/shell_content_utility_client.h" |
17 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/base/ui_base_paths.h" | 18 #include "ui/base/ui_base_paths.h" |
19 | 19 |
20 #if defined(OS_MACOSX) | 20 #if defined(OS_MACOSX) |
21 #include "content/shell/paths_mac.h" | 21 #include "content/shell/paths_mac.h" |
22 #endif // OS_MACOSX | 22 #endif // OS_MACOSX |
23 | 23 |
24 ShellMainDelegate::ShellMainDelegate() { | 24 ShellMainDelegate::ShellMainDelegate() { |
25 } | 25 } |
26 | 26 |
27 ShellMainDelegate::~ShellMainDelegate() { | 27 ShellMainDelegate::~ShellMainDelegate() { |
| 28 #if defined(OS_ANDROID) |
| 29 NOTREACHED(); |
| 30 #endif |
28 } | 31 } |
29 | 32 |
30 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { | 33 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { |
31 #if defined(OS_MACOSX) | 34 #if defined(OS_MACOSX) |
32 OverrideFrameworkBundlePath(); | 35 OverrideFrameworkBundlePath(); |
33 #endif | 36 #endif |
34 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 37 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
35 std::string process_type = | 38 std::string process_type = |
36 command_line.GetSwitchValueASCII(switches::kProcessType); | 39 command_line.GetSwitchValueASCII(switches::kProcessType); |
37 content::SetContentClient(&content_client_); | 40 content::SetContentClient(&content_client_); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 content::GetContentClient()->set_utility(utility_client_.get()); | 113 content::GetContentClient()->set_utility(utility_client_.get()); |
111 } | 114 } |
112 } | 115 } |
113 | 116 |
114 void ShellMainDelegate::InitializeResourceBundle() { | 117 void ShellMainDelegate::InitializeResourceBundle() { |
115 FilePath pak_file; | 118 FilePath pak_file; |
116 #if defined(OS_MACOSX) | 119 #if defined(OS_MACOSX) |
117 pak_file = GetResourcesPakFilePath(); | 120 pak_file = GetResourcesPakFilePath(); |
118 #else | 121 #else |
119 FilePath pak_dir; | 122 FilePath pak_dir; |
| 123 |
| 124 #if defined(OS_ANDROID) |
| 125 DCHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_dir)); |
| 126 pak_dir = pak_dir.Append(FILE_PATH_LITERAL("paks")); |
| 127 #else |
120 PathService::Get(base::DIR_MODULE, &pak_dir); | 128 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 129 #endif |
| 130 |
121 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")); | 131 pak_file = pak_dir.Append(FILE_PATH_LITERAL("content_shell.pak")); |
122 #endif | 132 #endif |
123 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file); | 133 ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_file); |
124 } | 134 } |
OLD | NEW |