Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 resource_delegate_.reset(new CastResourceDelegate()); | |
| 48 // TODO(gunsch): Use InitSharedInstanceWithLocale once ResourceBundle no | |
| 49 // longer hardcodes resource file names. | |
| 50 ui::ResourceBundle::InitSharedInstanceLocaleOnly("en-US", | |
| 51 resource_delegate_.get()); | |
|
byungchul
2014/08/14 20:34:11
wrong indentation
gunsch
2014/08/15 00:04:27
Done.
| |
| 52 | |
| 47 base::FilePath pak_file; | 53 base::FilePath pak_file; |
|
byungchul
2014/08/14 20:34:11
define at line 56
gunsch
2014/08/15 00:04:27
Done.
| |
| 48 base::FilePath pak_dir; | 54 base::FilePath pak_dir; |
| 49 | |
| 50 PathService::Get(base::DIR_MODULE, &pak_dir); | 55 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 51 | |
| 52 pak_file = pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")); | 56 pak_file = pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")); |
| 53 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); | 57 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(pak_file, |
| 58 ui::SCALE_FACTOR_NONE); | |
|
byungchul
2014/08/14 20:34:11
wrong indentation.
gunsch
2014/08/15 00:04:27
Done.
| |
| 54 } | 59 } |
| 55 | 60 |
| 56 content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() { | 61 content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() { |
| 57 browser_client_.reset(new CastContentBrowserClient); | 62 browser_client_.reset(new CastContentBrowserClient); |
| 58 return browser_client_.get(); | 63 return browser_client_.get(); |
| 59 } | 64 } |
| 60 | 65 |
| 61 content::ContentRendererClient* | 66 content::ContentRendererClient* |
| 62 CastMainDelegate::CreateContentRendererClient() { | 67 CastMainDelegate::CreateContentRendererClient() { |
| 63 renderer_client_.reset(new CastContentRendererClient); | 68 renderer_client_.reset(new CastContentRendererClient); |
| 64 return renderer_client_.get(); | 69 return renderer_client_.get(); |
| 65 } | 70 } |
| 66 | 71 |
| 67 } // namespace shell | 72 } // namespace shell |
| 68 } // namespace chromecast | 73 } // namespace chromecast |
| OLD | NEW |