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

Side by Side Diff: apps/shell/shell_main_delegate.cc

Issue 141143010: [App Shell] Enable Initialized Logging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 "apps/shell/shell_content_client.h" 8 #include "apps/shell/shell_content_client.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "content/public/browser/browser_main_runner.h" 13 #include "content/public/browser/browser_main_runner.h"
14 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
15 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
16 namespace apps { 32 namespace apps {
17 33
18 ShellMainDelegate::ShellMainDelegate() { 34 ShellMainDelegate::ShellMainDelegate() {
19 } 35 }
20 36
21 ShellMainDelegate::~ShellMainDelegate() { 37 ShellMainDelegate::~ShellMainDelegate() {
22 } 38 }
23 39
24 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { 40 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
25 // TODO(jamescook): Initialize logging here. 41 InitLogging();
26 content_client_.reset(new ShellContentClient); 42 content_client_.reset(new ShellContentClient);
27 SetContentClient(content_client_.get()); 43 SetContentClient(content_client_.get());
28 return false; 44 return false;
29 } 45 }
30 46
31 void ShellMainDelegate::PreSandboxStartup() { 47 void ShellMainDelegate::PreSandboxStartup() {
32 InitializeResourceBundle(); 48 InitializeResourceBundle();
33 } 49 }
34 50
35 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() { 51 content::ContentBrowserClient* ShellMainDelegate::CreateContentBrowserClient() {
36 browser_client_.reset(new apps::ShellContentBrowserClient); 52 browser_client_.reset(new apps::ShellContentBrowserClient);
37 return browser_client_.get(); 53 return browser_client_.get();
38 } 54 }
39 55
40 content::ContentRendererClient* 56 content::ContentRendererClient*
41 ShellMainDelegate::CreateContentRendererClient() { 57 ShellMainDelegate::CreateContentRendererClient() {
42 // TODO(jamescook): Create a ShellContentRendererClient with the extensions 58 // TODO(jamescook): Create a ShellContentRendererClient with the extensions
43 // initialization pieces of ChromeContentRendererClient. 59 // initialization pieces of ChromeContentRendererClient.
44 return content::ContentMainDelegate::CreateContentRendererClient(); 60 return content::ContentMainDelegate::CreateContentRendererClient();
45 } 61 }
46 62
47 void ShellMainDelegate::InitializeResourceBundle() { 63 void ShellMainDelegate::InitializeResourceBundle() {
48 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); 64 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
49 } 65 }
50 66
51 } // namespace apps 67 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698