OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chromecast/shell/app/cast_main_delegate.h" |
| 6 |
| 7 #include "base/base_paths.h" |
| 8 #include "base/logging.h" |
| 9 #include "base/path_service.h" |
| 10 #include "chromecast/common/cast_paths.h" |
| 11 #include "chromecast/shell/browser/cast_content_browser_client.h" |
| 12 #include "chromecast/shell/renderer/cast_content_renderer_client.h" |
| 13 #include "content/public/common/content_switches.h" |
| 14 #include "ui/base/resource/resource_bundle.h" |
| 15 |
| 16 namespace chromecast { |
| 17 namespace shell { |
| 18 |
| 19 CastMainDelegate::CastMainDelegate() { |
| 20 } |
| 21 |
| 22 CastMainDelegate::~CastMainDelegate() { |
| 23 } |
| 24 |
| 25 bool CastMainDelegate::BasicStartupComplete(int* exit_code) { |
| 26 logging::LoggingSettings settings; |
| 27 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 28 logging::InitLogging(settings); |
| 29 // Time, process, and thread ID are available through logcat. |
| 30 logging::SetLogItems(true, true, false, false); |
| 31 |
| 32 RegisterPathProvider(); |
| 33 |
| 34 content::SetContentClient(&content_client_); |
| 35 return false; |
| 36 } |
| 37 |
| 38 void CastMainDelegate::PreSandboxStartup() { |
| 39 InitializeResourceBundle(); |
| 40 } |
| 41 |
| 42 void CastMainDelegate::ZygoteForked() { |
| 43 } |
| 44 |
| 45 // static |
| 46 void CastMainDelegate::InitializeResourceBundle() { |
| 47 base::FilePath pak_file; |
| 48 base::FilePath pak_dir; |
| 49 |
| 50 PathService::Get(base::DIR_MODULE, &pak_dir); |
| 51 |
| 52 pak_file = pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")); |
| 53 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
| 54 } |
| 55 |
| 56 content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() { |
| 57 browser_client_.reset(new CastContentBrowserClient); |
| 58 return browser_client_.get(); |
| 59 } |
| 60 |
| 61 content::ContentRendererClient* |
| 62 CastMainDelegate::CreateContentRendererClient() { |
| 63 renderer_client_.reset(new CastContentRendererClient); |
| 64 return renderer_client_.get(); |
| 65 } |
| 66 |
| 67 } // namespace shell |
| 68 } // namespace chromecast |
OLD | NEW |