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

Unified Diff: content/shell/shell_main_delegate.cc

Issue 10693157: Add pak file support for content shell and android apks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 months 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 | « content/shell/shell_content_browser_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_main_delegate.cc
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc
index afcbebf4fa6b8ce573256ab3f31e6ffb1f2d751c..35162e864d9c82533b0af8464fa002090d603dd5 100644
--- a/content/shell/shell_main_delegate.cc
+++ b/content/shell/shell_main_delegate.cc
@@ -18,6 +18,11 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#if defined(OS_ANDROID)
+#include "base/global_descriptors_posix.h"
+#include "content/shell/android/shell_descriptors.h"
+#endif
+
#if defined(OS_MACOSX)
#include "content/shell/paths_mac.h"
#endif // OS_MACOSX
@@ -88,6 +93,20 @@ int ShellMainDelegate::RunProcess(
}
void ShellMainDelegate::InitializeResourceBundle() {
+#if defined(OS_ANDROID)
+ // In the Android case, the renderer runs with a different UID and can never
+ // access the file system. So we are passed a file descriptor to the
+ // ResourceBundle pak at launch time.
+ int pak_fd =
+ base::GlobalDescriptors::GetInstance()->MaybeGet(kShellPakDescriptor);
+ if (pak_fd != base::kInvalidPlatformFileValue) {
+ ui::ResourceBundle::InitSharedInstanceWithPakFile(pak_fd, false);
+ ResourceBundle::GetSharedInstance().AddDataPackFromFile(
+ pak_fd, ui::SCALE_FACTOR_100P);
+ return;
+ }
+#endif
+
FilePath pak_file;
#if defined(OS_MACOSX)
pak_file = GetResourcesPakFilePath();
« no previous file with comments | « content/shell/shell_content_browser_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698