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

Side by Side Diff: chromecast/shell/app/cast_main_delegate.cc

Issue 223143003: Initial checkin of chromecast content embedder (cast_shell) and related build scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional presubmit clean-up. Created 6 years, 5 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698