Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0bafee42629c64201bd64cab0febc32c28644db4 |
| --- /dev/null |
| +++ b/chromecast/shell/app/cast_main_delegate.cc |
| @@ -0,0 +1,70 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromecast/shell/app/cast_main_delegate.h" |
| + |
| +#include "base/base_paths.h" |
| +#include "base/logging.h" |
| +#include "base/path_service.h" |
| +#include "chromecast/common/cast_paths.h" |
| +#include "chromecast/shell/browser/cast_content_browser_client.h" |
| +#include "chromecast/shell/renderer/cast_content_renderer_client.h" |
| +#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
|
| +#include "content/public/common/content_switches.h" |
| +#include "ui/base/resource/resource_bundle.h" |
| + |
| +namespace chromecast { |
| +namespace shell { |
| + |
| +CastMainDelegate::CastMainDelegate() { |
| +} |
| + |
| +CastMainDelegate::~CastMainDelegate() { |
| +} |
| + |
| +bool CastMainDelegate::BasicStartupComplete(int* exit_code) { |
| + logging::LoggingSettings settings; |
| + settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| + logging::InitLogging(settings); |
| + // Time, process, and thread ID are available through logcat. |
| + logging::SetLogItems(true, true, false, false); |
| + |
| + RegisterPathProvider(); |
| + |
| + content::SetContentClient(&content_client_); |
| + return false; |
| +} |
| + |
| +void CastMainDelegate::PreSandboxStartup() { |
| + InitializeResourceBundle(); |
| +} |
| + |
| +void CastMainDelegate::ZygoteForked() { |
| + // TODO(lcwu): Initialize crash reporter here. |
| +} |
| + |
| +// static |
| +void CastMainDelegate::InitializeResourceBundle() { |
| + base::FilePath pak_file; |
| + 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); |
| +} |
| + |
| +content::ContentBrowserClient* CastMainDelegate::CreateContentBrowserClient() { |
| + browser_client_.reset(new CastContentBrowserClient); |
| + return browser_client_.get(); |
| +} |
| + |
| +content::ContentRendererClient* |
| +CastMainDelegate::CreateContentRendererClient() { |
| + renderer_client_.reset(new CastContentRendererClient); |
| + return renderer_client_.get(); |
| +} |
| + |
| +} // namespace shell |
| +} // namespace chromecast |