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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/shell/app/cast_main_delegate.h" 5 #include "chromecast/shell/app/cast_main_delegate.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "chromecast/common/cast_paths.h" 10 #include "chromecast/common/cast_paths.h"
11 #include "chromecast/common/cast_resource_delegate.h"
11 #include "chromecast/shell/browser/cast_content_browser_client.h" 12 #include "chromecast/shell/browser/cast_content_browser_client.h"
12 #include "chromecast/shell/renderer/cast_content_renderer_client.h" 13 #include "chromecast/shell/renderer/cast_content_renderer_client.h"
13 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
14 #include "ui/base/resource/resource_bundle.h" 15 #include "ui/base/resource/resource_bundle.h"
15 16
16 namespace chromecast { 17 namespace chromecast {
17 namespace shell { 18 namespace shell {
18 19
19 CastMainDelegate::CastMainDelegate() { 20 CastMainDelegate::CastMainDelegate() {
20 } 21 }
(...skipping 14 matching lines...) Expand all
35 return false; 36 return false;
36 } 37 }
37 38
38 void CastMainDelegate::PreSandboxStartup() { 39 void CastMainDelegate::PreSandboxStartup() {
39 InitializeResourceBundle(); 40 InitializeResourceBundle();
40 } 41 }
41 42
42 void CastMainDelegate::ZygoteForked() { 43 void CastMainDelegate::ZygoteForked() {
43 } 44 }
44 45
45 // static
46 void CastMainDelegate::InitializeResourceBundle() { 46 void CastMainDelegate::InitializeResourceBundle() {
47 base::FilePath pak_file; 47 resource_delegate_.reset(new CastResourceDelegate());
48 // TODO(gunsch): Use LOAD_COMMON_RESOURCES once ResourceBundle no longer
49 // hardcodes resource file names.
50 ui::ResourceBundle::InitSharedInstanceWithLocale(
51 "en-US",
52 resource_delegate_.get(),
53 ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
54
48 base::FilePath pak_dir; 55 base::FilePath pak_dir;
49
50 PathService::Get(base::DIR_MODULE, &pak_dir); 56 PathService::Get(base::DIR_MODULE, &pak_dir);
51 57 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
52 pak_file = pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")); 58 pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")),
53 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); 59 ui::SCALE_FACTOR_NONE);
54 } 60 }
55 61
56 content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() { 62 content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() {
57 browser_client_.reset(new CastContentBrowserClient); 63 browser_client_.reset(new CastContentBrowserClient);
58 return browser_client_.get(); 64 return browser_client_.get();
59 } 65 }
60 66
61 content::ContentRendererClient* 67 content::ContentRendererClient*
62 CastMainDelegate::CreateContentRendererClient() { 68 CastMainDelegate::CreateContentRendererClient() {
63 renderer_client_.reset(new CastContentRendererClient); 69 renderer_client_.reset(new CastContentRendererClient);
64 return renderer_client_.get(); 70 return renderer_client_.get();
65 } 71 }
66 72
67 } // namespace shell 73 } // namespace shell
68 } // namespace chromecast 74 } // namespace chromecast
OLDNEW
« 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