OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 "apps/shell/shell_main_delegate.h" | |
6 | |
7 #include "apps/shell/shell_content_browser_client.h" | |
8 #include "apps/shell/shell_content_client.h" | |
9 #include "base/command_line.h" | |
10 #include "base/files/file_path.h" | |
11 #include "base/logging.h" | |
12 #include "base/path_service.h" | |
13 #include "content/public/browser/browser_main_runner.h" | |
14 #include "ui/base/resource/resource_bundle.h" | |
15 | |
16 namespace { | |
17 | |
18 void InitLogging() { | |
19 base::FilePath log_filename; | |
20 PathService::Get(base::DIR_EXE, &log_filename); | |
21 log_filename = log_filename.AppendASCII("app_shell.log"); | |
22 logging::LoggingSettings settings; | |
23 settings.logging_dest = logging::LOG_TO_ALL; | |
24 settings.log_file = log_filename.value().c_str(); | |
25 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | |
26 logging::InitLogging(settings); | |
27 logging::SetLogItems(true, true, true, true); | |
28 } | |
29 | |
30 } // namespace | |
31 | |
32 namespace apps { | |
33 | |
34 ShellMainDelegate::ShellMainDelegate() { | |
35 } | |
36 | |
37 ShellMainDelegate::~ShellMainDelegate() { | |
38 } | |
39 | |
40 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { | |
41 InitLogging(); | |
42 content_client_.reset(new ShellContentClient); | |
43 SetContentClient(content_client_.get()); | |
44 return false; | |
45 } | |
46 | |
47 void ShellMainDelegate::PreSandboxStartup() { | |
48 InitializeResourceBundle(); | |
49 } | |
50 | |
51 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { | |
52 browser_client_.reset(new apps::ShellContentBrowserClient); | |
53 return browser_client_.get(); | |
54 } | |
55 | |
56 content::ContentRendererClient* | |
57 ShellMainDelegate::CreateContentRendererClient() { | |
58 // TODO(jamescook): Create a ShellContentRendererClient with the extensions | |
59 // initialization pieces of ChromeContentRendererClient. | |
60 return content::ContentMainDelegate::CreateContentRendererClient(); | |
61 } | |
62 | |
63 void ShellMainDelegate::InitializeResourceBundle() { | |
64 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | |
65 } | |
66 | |
67 } // namespace apps | |
OLD | NEW |