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

Unified Diff: chromecast/shell/app/cast_main_delegate.cc

Issue 467043002: Adds locale strings to Chromecast build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 4 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
Index: chromecast/shell/app/cast_main_delegate.cc
diff --git a/chromecast/shell/app/cast_main_delegate.cc b/chromecast/shell/app/cast_main_delegate.cc
index 87c5fbf69536c7c453f66da39f5db79f19de10f5..4d3284d8bac951432173be3a2839d81204749fb8 100644
--- a/chromecast/shell/app/cast_main_delegate.cc
+++ b/chromecast/shell/app/cast_main_delegate.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "chromecast/common/cast_paths.h"
+#include "chromecast/common/cast_resource_delegate.h"
#include "chromecast/shell/browser/cast_content_browser_client.h"
#include "chromecast/shell/renderer/cast_content_renderer_client.h"
#include "content/public/common/content_switches.h"
@@ -42,15 +43,20 @@ void CastMainDelegate::PreSandboxStartup() {
void CastMainDelegate::ZygoteForked() {
}
-// static
void CastMainDelegate::InitializeResourceBundle() {
- base::FilePath pak_file;
- base::FilePath pak_dir;
+ resource_delegate_.reset(new CastResourceDelegate());
+ // TODO(gunsch): Use LOAD_COMMON_RESOURCES once ResourceBundle no longer
+ // hardcodes resource file names.
+ ui::ResourceBundle::InitSharedInstanceWithLocale(
+ "en-US",
+ resource_delegate_.get(),
+ ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
+ base::FilePath pak_dir;
PathService::Get(base::DIR_MODULE, &pak_dir);
-
- pak_file = pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak"));
- ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
+ ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
+ pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")),
+ ui::SCALE_FACTOR_NONE);
}
content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() {
« no previous file with comments | « chromecast/shell/app/cast_main_delegate.h ('k') | chromecast/shell/browser/cast_http_user_agent_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698