OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/cast_browser_main_parts.h" | 5 #include "chromecast/browser/cast_browser_main_parts.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "chromecast/base/metrics/cast_metrics_helper.h" | 10 #include "chromecast/base/metrics/cast_metrics_helper.h" |
11 #include "chromecast/browser/cast_browser_context.h" | 11 #include "chromecast/browser/cast_browser_context.h" |
12 #include "chromecast/browser/cast_browser_process.h" | 12 #include "chromecast/browser/cast_browser_process.h" |
13 #include "chromecast/browser/devtools/remote_debugging_server.h" | 13 #include "chromecast/browser/devtools/remote_debugging_server.h" |
14 #include "chromecast/browser/metrics/cast_metrics_prefs.h" | 14 #include "chromecast/browser/metrics/cast_metrics_prefs.h" |
15 #include "chromecast/browser/metrics/cast_metrics_service_client.h" | 15 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
16 #include "chromecast/browser/service/cast_service.h" | 16 #include "chromecast/browser/service/cast_service.h" |
17 #include "chromecast/browser/url_request_context_factory.h" | 17 #include "chromecast/browser/url_request_context_factory.h" |
18 #include "chromecast/browser/webui/webui_cast.h" | 18 #include "chromecast/browser/webui/webui_cast.h" |
19 #include "chromecast/common/chromecast_config.h" | 19 #include "chromecast/common/chromecast_config.h" |
| 20 #include "chromecast/common/platform_client_auth.h" |
20 #include "chromecast/net/network_change_notifier_cast.h" | 21 #include "chromecast/net/network_change_notifier_cast.h" |
21 #include "chromecast/net/network_change_notifier_factory_cast.h" | 22 #include "chromecast/net/network_change_notifier_factory_cast.h" |
22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
24 #include "media/base/media_switches.h" | 25 #include "media/base/media_switches.h" |
25 | 26 |
26 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
27 #include "chromecast/crash/android/crash_handler.h" | 28 #include "chromecast/crash/android/crash_handler.h" |
28 #include "components/crash/browser/crash_dump_manager_android.h" | 29 #include "components/crash/browser/crash_dump_manager_android.h" |
29 #include "net/android/network_change_notifier_factory_android.h" | 30 #include "net/android/network_change_notifier_factory_android.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 120 |
120 #if defined(OS_ANDROID) | 121 #if defined(OS_ANDROID) |
121 base::FilePath crash_dumps_dir; | 122 base::FilePath crash_dumps_dir; |
122 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { | 123 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { |
123 LOG(ERROR) << "Could not find crash dump location."; | 124 LOG(ERROR) << "Could not find crash dump location."; |
124 } | 125 } |
125 cast_browser_process_->SetCrashDumpManager( | 126 cast_browser_process_->SetCrashDumpManager( |
126 new breakpad::CrashDumpManager(crash_dumps_dir)); | 127 new breakpad::CrashDumpManager(crash_dumps_dir)); |
127 #endif | 128 #endif |
128 | 129 |
| 130 if (!PlatformClientAuth::Initialize()) { |
| 131 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; |
| 132 } |
| 133 |
129 cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer()); | 134 cast_browser_process_->SetRemoteDebuggingServer(new RemoteDebuggingServer()); |
130 | 135 |
131 InitializeWebUI(); | 136 InitializeWebUI(); |
132 | 137 |
133 cast_browser_process_->SetCastService(CastService::Create( | 138 cast_browser_process_->SetCastService(CastService::Create( |
134 cast_browser_process_->browser_context(), | 139 cast_browser_process_->browser_context(), |
135 url_request_context_factory_->GetSystemGetter(), | 140 url_request_context_factory_->GetSystemGetter(), |
136 base::Bind( | 141 base::Bind( |
137 &metrics::CastMetricsServiceClient::EnableMetricsService, | 142 &metrics::CastMetricsServiceClient::EnableMetricsService, |
138 base::Unretained(cast_browser_process_->metrics_service_client())))); | 143 base::Unretained(cast_browser_process_->metrics_service_client())))); |
(...skipping 14 matching lines...) Expand all Loading... |
153 return true; | 158 return true; |
154 } | 159 } |
155 | 160 |
156 void CastBrowserMainParts::PostMainMessageLoopRun() { | 161 void CastBrowserMainParts::PostMainMessageLoopRun() { |
157 cast_browser_process_->cast_service()->Stop(); | 162 cast_browser_process_->cast_service()->Stop(); |
158 cast_browser_process_.reset(); | 163 cast_browser_process_.reset(); |
159 } | 164 } |
160 | 165 |
161 } // namespace shell | 166 } // namespace shell |
162 } // namespace chromecast | 167 } // namespace chromecast |
OLD | NEW |