OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "ui/views/examples/content_client/examples_main_delegate.h" | 5 #include "ui/views_content_client/views_content_main_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
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/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/base/ui_base_paths.h" | 15 #include "ui/base/ui_base_paths.h" |
16 #include "ui/views/examples/content_client/examples_content_browser_client.h" | 16 #include "ui/views_content_client/views_content_browser_client.h" |
17 | 17 |
18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
19 #include "base/logging_win.h" | 19 #include "base/logging_win.h" |
20 #endif | 20 #endif |
21 | 21 |
22 namespace views { | 22 namespace ui { |
23 namespace examples { | |
24 namespace { | 23 namespace { |
25 | 24 |
26 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
27 // {83FAC8EE-7A0E-4dbb-A3F6-6F500D7CAB1A} | 26 // {83FAC8EE-7A0E-4dbb-A3F6-6F500D7CAB1A} |
28 const GUID kViewsExamplesProviderName = | 27 const GUID kViewsContentClientProviderName = |
29 { 0x83fac8ee, 0x7a0e, 0x4dbb, | 28 { 0x83fac8ee, 0x7a0e, 0x4dbb, |
30 { 0xa3, 0xf6, 0x6f, 0x50, 0xd, 0x7c, 0xab, 0x1a } }; | 29 { 0xa3, 0xf6, 0x6f, 0x50, 0xd, 0x7c, 0xab, 0x1a } }; |
31 #endif | 30 #endif |
32 | 31 |
33 } // namespace | 32 } // namespace |
34 | 33 |
35 ExamplesMainDelegate::ExamplesMainDelegate() { | 34 ViewsContentMainDelegate::ViewsContentMainDelegate( |
| 35 ViewsContentClient* views_content_client) |
| 36 : views_content_client_(views_content_client) { |
36 } | 37 } |
37 | 38 |
38 ExamplesMainDelegate::~ExamplesMainDelegate() { | 39 ViewsContentMainDelegate::~ViewsContentMainDelegate() { |
39 } | 40 } |
40 | 41 |
41 bool ExamplesMainDelegate::BasicStartupComplete(int* exit_code) { | 42 bool ViewsContentMainDelegate::BasicStartupComplete(int* exit_code) { |
42 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 43 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
43 std::string process_type = | 44 std::string process_type = |
44 command_line.GetSwitchValueASCII(switches::kProcessType); | 45 command_line.GetSwitchValueASCII(switches::kProcessType); |
45 | 46 |
46 content::SetContentClient(&content_client_); | 47 content::SetContentClient(&content_client_); |
47 | 48 |
48 logging::LoggingSettings settings; | 49 logging::LoggingSettings settings; |
49 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 50 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
50 bool success = logging::InitLogging(settings); | 51 bool success = logging::InitLogging(settings); |
51 CHECK(success); | 52 CHECK(success); |
52 #if defined(OS_WIN) | 53 #if defined(OS_WIN) |
53 logging::LogEventProvider::Initialize(kViewsExamplesProviderName); | 54 logging::LogEventProvider::Initialize(kViewsContentClientProviderName); |
54 #endif | 55 #endif |
55 | 56 |
56 return false; | 57 return false; |
57 } | 58 } |
58 | 59 |
59 void ExamplesMainDelegate::PreSandboxStartup() { | 60 void ViewsContentMainDelegate::PreSandboxStartup() { |
60 base::FilePath ui_test_pak_path; | 61 base::FilePath ui_test_pak_path; |
61 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); | 62 DCHECK(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
62 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); | 63 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
63 } | 64 } |
64 | 65 |
65 content::ContentBrowserClient* | 66 content::ContentBrowserClient* |
66 ExamplesMainDelegate::CreateContentBrowserClient() { | 67 ViewsContentMainDelegate::CreateContentBrowserClient() { |
67 browser_client_.reset(new ExamplesContentBrowserClient); | 68 browser_client_.reset(new ViewsContentBrowserClient(views_content_client_)); |
68 return browser_client_.get(); | 69 return browser_client_.get(); |
69 } | 70 } |
70 | 71 |
71 } // namespace examples | 72 } // namespace ui |
72 } // namespace views | |
OLD | NEW |