Chromium Code Reviews| 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/browser/browser_main_runner.h" | |
|
jam
2014/07/01 21:56:09
doesn't look like this is used? if so, no need to
lcwu1
2014/07/02 23:30:33
Done. (also changed content/public to content/publ
| |
| 14 #include "content/public/common/content_switches.h" | |
| 15 #include "ui/base/resource/resource_bundle.h" | |
| 16 | |
| 17 namespace chromecast { | |
| 18 namespace shell { | |
| 19 | |
| 20 CastMainDelegate::CastMainDelegate() { | |
| 21 } | |
| 22 | |
| 23 CastMainDelegate::~CastMainDelegate() { | |
| 24 } | |
| 25 | |
| 26 bool CastMainDelegate::BasicStartupComplete(int* exit_code) { | |
| 27 logging::LoggingSettings settings; | |
| 28 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | |
| 29 logging::InitLogging(settings); | |
| 30 // Time, process, and thread ID are available through logcat. | |
| 31 logging::SetLogItems(true, true, false, false); | |
| 32 | |
| 33 RegisterPathProvider(); | |
| 34 | |
| 35 content::SetContentClient(&content_client_); | |
| 36 return false; | |
| 37 } | |
| 38 | |
| 39 void CastMainDelegate::PreSandboxStartup() { | |
| 40 InitializeResourceBundle(); | |
| 41 } | |
| 42 | |
| 43 void CastMainDelegate::ZygoteForked() { | |
| 44 // TODO(lcwu): Initialize crash reporter here. | |
| 45 } | |
| 46 | |
| 47 // static | |
| 48 void CastMainDelegate::InitializeResourceBundle() { | |
| 49 base::FilePath pak_file; | |
| 50 base::FilePath pak_dir; | |
| 51 | |
| 52 PathService::Get(base::DIR_MODULE, &pak_dir); | |
| 53 | |
| 54 pak_file = pak_dir.Append(FILE_PATH_LITERAL("cast_shell.pak")); | |
| 55 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); | |
| 56 } | |
| 57 | |
| 58 content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() { | |
| 59 browser_client_.reset(new CastContentBrowserClient); | |
| 60 return browser_client_.get(); | |
| 61 } | |
| 62 | |
| 63 content::ContentRendererClient* | |
| 64 CastMainDelegate::CreateContentRendererClient() { | |
| 65 renderer_client_.reset(new CastContentRendererClient); | |
| 66 return renderer_client_.get(); | |
| 67 } | |
| 68 | |
| 69 } // namespace shell | |
| 70 } // namespace chromecast | |
| OLD | NEW |