1 // Copyright (c) 2012 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.
5 #include "ui/views/examples/content_client/examples_main_delegate.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/common/content_switches.h"
14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/base/ui_base_paths.h"
16 #include "ui/views/examples/content_client/examples_content_browser_client.h"
19 #include "base/logging_win.h"
27 // {83FAC8EE-7A0E-4dbb-A3F6-6F500D7CAB1A}
28 const GUID kViewsExamplesProviderName =
29 { 0x83fac8ee, 0x7a0e, 0x4dbb,
30 { 0xa3, 0xf6, 0x6f, 0x50, 0xd, 0x7c, 0xab, 0x1a } };
35 ExamplesMainDelegate::ExamplesMainDelegate() {
38 ExamplesMainDelegate::~ExamplesMainDelegate() {
41 bool ExamplesMainDelegate::BasicStartupComplete(int* exit_code) {
42 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
43 std::string process_type =
44 command_line.GetSwitchValueASCII(switches::kProcessType);
46 content::SetContentClient(&content_client_);
48 logging::LoggingSettings settings;
49 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
50 bool success = logging::InitLogging(settings);
53 logging::LogEventProvider::Initialize(kViewsExamplesProviderName);
59 void ExamplesMainDelegate::PreSandboxStartup() {
60 InitializeResourceBundle();
63 content::ContentBrowserClient*
64 ExamplesMainDelegate::CreateContentBrowserClient() {
65 browser_client_.reset(new ExamplesContentBrowserClient);
66 return browser_client_.get();
69 void ExamplesMainDelegate::InitializeResourceBundle() {
70 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL);
73 } // namespace examples