Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "apps/shell/shell_main_delegate.h" | 5 #include "apps/shell/shell_main_delegate.h" |
| 6 | 6 |
| 7 #include "apps/shell/shell_content_browser_client.h" | 7 #include "apps/shell/shell_content_browser_client.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "content/public/browser/browser_main_runner.h" | 12 #include "content/public/browser/browser_main_runner.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 14 | 14 |
| 15 namespace { | |
| 16 | |
| 17 void InitLogging() { | |
| 18 base::FilePath log_filename; | |
| 19 PathService::Get(base::DIR_EXE, &log_filename); | |
| 20 log_filename = log_filename.AppendASCII("app_shell.log"); | |
| 21 logging::LoggingSettings settings; | |
| 22 settings.logging_dest = logging::LOG_TO_ALL; | |
| 23 settings.log_file = log_filename.value().c_str(); | |
| 24 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | |
| 25 logging::InitLogging(settings); | |
| 26 logging::SetLogItems(true, true, true, true); | |
| 27 } | |
| 28 | |
| 29 } // namepspace | |
|
James Cook
2014/01/27 19:21:34
nit: namepspace -> namespace
| |
| 30 | |
| 15 namespace apps { | 31 namespace apps { |
| 16 | 32 |
| 17 ShellMainDelegate::ShellMainDelegate() { | 33 ShellMainDelegate::ShellMainDelegate() { |
| 18 } | 34 } |
| 19 | 35 |
| 20 ShellMainDelegate::~ShellMainDelegate() { | 36 ShellMainDelegate::~ShellMainDelegate() { |
| 21 } | 37 } |
| 22 | 38 |
| 23 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { | 39 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { |
| 24 // TODO(jamescook): Initialize logging here. | 40 InitLogging(); |
| 25 SetContentClient(&content_client_); | 41 SetContentClient(&content_client_); |
| 26 return false; | 42 return false; |
| 27 } | 43 } |
| 28 | 44 |
| 29 void ShellMainDelegate::PreSandboxStartup() { | 45 void ShellMainDelegate::PreSandboxStartup() { |
| 30 InitializeResourceBundle(); | 46 InitializeResourceBundle(); |
| 31 } | 47 } |
| 32 | 48 |
| 33 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { | 49 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { |
| 34 browser_client_.reset(new apps::ShellContentBrowserClient); | 50 browser_client_.reset(new apps::ShellContentBrowserClient); |
| 35 return browser_client_.get(); | 51 return browser_client_.get(); |
| 36 } | 52 } |
| 37 | 53 |
| 38 void ShellMainDelegate::InitializeResourceBundle() { | 54 void ShellMainDelegate::InitializeResourceBundle() { |
| 39 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); | 55 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 40 } | 56 } |
| 41 | 57 |
| 42 } // namespace apps | 58 } // namespace apps |
| OLD | NEW |