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_content_browser_client.h" | 5 #include "chromecast/browser/cast_content_browser_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
12 #include "base/i18n/rtl.h" | |
13 #include "base/path_service.h" | 12 #include "base/path_service.h" |
14 #include "chromecast/browser/cast_browser_context.h" | 13 #include "chromecast/browser/cast_browser_context.h" |
15 #include "chromecast/browser/cast_browser_main_parts.h" | 14 #include "chromecast/browser/cast_browser_main_parts.h" |
16 #include "chromecast/browser/cast_browser_process.h" | 15 #include "chromecast/browser/cast_browser_process.h" |
17 #include "chromecast/browser/cast_network_delegate.h" | 16 #include "chromecast/browser/cast_network_delegate.h" |
18 #include "chromecast/browser/devtools/cast_dev_tools_delegate.h" | 17 #include "chromecast/browser/devtools/cast_dev_tools_delegate.h" |
19 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 18 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
20 #include "chromecast/browser/media/cma_message_filter_host.h" | 19 #include "chromecast/browser/media/cma_message_filter_host.h" |
21 #include "chromecast/browser/url_request_context_factory.h" | 20 #include "chromecast/browser/url_request_context_factory.h" |
22 #include "chromecast/common/cast_paths.h" | 21 #include "chromecast/common/cast_paths.h" |
23 #include "chromecast/common/chromecast_switches.h" | 22 #include "chromecast/common/chromecast_switches.h" |
24 #include "chromecast/common/global_descriptors.h" | 23 #include "chromecast/common/global_descriptors.h" |
25 #include "components/crash/app/breakpad_linux.h" | 24 #include "components/crash/app/breakpad_linux.h" |
26 #include "components/crash/browser/crash_handler_host_linux.h" | 25 #include "components/crash/browser/crash_handler_host_linux.h" |
27 #include "components/dns_prefetch/browser/net_message_filter.h" | 26 #include "components/dns_prefetch/browser/net_message_filter.h" |
28 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/certificate_request_result_type.h" | 28 #include "content/public/browser/certificate_request_result_type.h" |
30 #include "content/public/browser/render_process_host.h" | 29 #include "content/public/browser/render_process_host.h" |
31 #include "content/public/common/content_descriptors.h" | 30 #include "content/public/common/content_descriptors.h" |
32 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
33 #include "content/public/common/url_constants.h" | 32 #include "content/public/common/url_constants.h" |
34 #include "content/public/common/web_preferences.h" | 33 #include "content/public/common/web_preferences.h" |
35 #include "net/ssl/ssl_cert_request_info.h" | 34 #include "net/ssl/ssl_cert_request_info.h" |
| 35 #include "ui/base/l10n/l10n_util.h" |
36 | 36 |
37 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
38 #include "chromecast/browser/android/external_video_surface_container_impl.h" | 38 #include "chromecast/browser/android/external_video_surface_container_impl.h" |
39 #endif // defined(OS_ANDROID) | 39 #endif // defined(OS_ANDROID) |
40 | 40 |
41 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
42 #include "components/crash/browser/crash_dump_manager_android.h" | 42 #include "components/crash/browser/crash_dump_manager_android.h" |
43 #endif // defined(OS_ANDROID) | 43 #endif // defined(OS_ANDROID) |
44 | 44 |
45 namespace chromecast { | 45 namespace chromecast { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // to retrieve media data chunks while running in a https page. This pref | 152 // to retrieve media data chunks while running in a https page. This pref |
153 // should be disabled once all the content providers are no longer doing that. | 153 // should be disabled once all the content providers are no longer doing that. |
154 prefs->allow_running_insecure_content = true; | 154 prefs->allow_running_insecure_content = true; |
155 #if defined(DISABLE_DISPLAY) | 155 #if defined(DISABLE_DISPLAY) |
156 prefs->images_enabled = false; | 156 prefs->images_enabled = false; |
157 prefs->loads_images_automatically = false; | 157 prefs->loads_images_automatically = false; |
158 #endif // defined(DISABLE_DISPLAY) | 158 #endif // defined(DISABLE_DISPLAY) |
159 } | 159 } |
160 | 160 |
161 std::string CastContentBrowserClient::GetApplicationLocale() { | 161 std::string CastContentBrowserClient::GetApplicationLocale() { |
162 const std::string locale(base::i18n::GetConfiguredLocale()); | 162 const std::string locale(l10n_util::GetConfiguredLocale()); |
163 return locale.empty() ? "en-US" : locale; | 163 return locale.empty() ? "en-US" : locale; |
164 } | 164 } |
165 | 165 |
166 void CastContentBrowserClient::AllowCertificateError( | 166 void CastContentBrowserClient::AllowCertificateError( |
167 int render_process_id, | 167 int render_process_id, |
168 int render_view_id, | 168 int render_view_id, |
169 int cert_error, | 169 int cert_error, |
170 const net::SSLInfo& ssl_info, | 170 const net::SSLInfo& ssl_info, |
171 const GURL& request_url, | 171 const GURL& request_url, |
172 content::ResourceType resource_type, | 172 content::ResourceType resource_type, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 process_type, dumps_path, false /* upload */); | 336 process_type, dumps_path, false /* upload */); |
337 // StartUploaderThread() even though upload is diferred. | 337 // StartUploaderThread() even though upload is diferred. |
338 // Breakpad-related memory is freed in the uploader thread. | 338 // Breakpad-related memory is freed in the uploader thread. |
339 crash_handler->StartUploaderThread(); | 339 crash_handler->StartUploaderThread(); |
340 return crash_handler; | 340 return crash_handler; |
341 } | 341 } |
342 #endif // !defined(OS_ANDROID) | 342 #endif // !defined(OS_ANDROID) |
343 | 343 |
344 } // namespace shell | 344 } // namespace shell |
345 } // namespace chromecast | 345 } // namespace chromecast |
OLD | NEW |