OLD | NEW |
1 // Copyright (c) 2012 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 "chrome/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "components/dom_distiller/core/url_constants.h" | 36 #include "components/dom_distiller/core/url_constants.h" |
37 #include "components/version_info/version_info.h" | 37 #include "components/version_info/version_info.h" |
38 #include "content/public/common/cdm_info.h" | 38 #include "content/public/common/cdm_info.h" |
39 #include "content/public/common/content_constants.h" | 39 #include "content/public/common/content_constants.h" |
40 #include "content/public/common/content_switches.h" | 40 #include "content/public/common/content_switches.h" |
41 #include "content/public/common/url_constants.h" | 41 #include "content/public/common/url_constants.h" |
42 #include "content/public/common/user_agent.h" | 42 #include "content/public/common/user_agent.h" |
43 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
44 #include "extensions/features/features.h" | 44 #include "extensions/features/features.h" |
45 #include "gpu/config/gpu_info.h" | 45 #include "gpu/config/gpu_info.h" |
46 #include "gpu/config/gpu_util.h" | |
47 #include "media/media_features.h" | 46 #include "media/media_features.h" |
48 #include "net/http/http_util.h" | 47 #include "net/http/http_util.h" |
49 #include "pdf/features.h" | 48 #include "pdf/features.h" |
50 #include "ppapi/features/features.h" | 49 #include "ppapi/features/features.h" |
51 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
52 #include "ui/base/layout.h" | 51 #include "ui/base/layout.h" |
53 #include "ui/base/resource/resource_bundle.h" | 52 #include "ui/base/resource/resource_bundle.h" |
54 #include "url/url_constants.h" | 53 #include "url/url_constants.h" |
55 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 54 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
56 | 55 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 g_pdf_shutdown_module = shutdown_module; | 442 g_pdf_shutdown_module = shutdown_module; |
444 } | 443 } |
445 #endif | 444 #endif |
446 | 445 |
447 void ChromeContentClient::SetActiveURL(const GURL& url) { | 446 void ChromeContentClient::SetActiveURL(const GURL& url) { |
448 base::debug::SetCrashKeyValue(crash_keys::kActiveURL, | 447 base::debug::SetCrashKeyValue(crash_keys::kActiveURL, |
449 url.possibly_invalid_spec()); | 448 url.possibly_invalid_spec()); |
450 } | 449 } |
451 | 450 |
452 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { | 451 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { |
453 gpu::SetKeysForCrashLogging(gpu_info); | 452 #if !defined(OS_ANDROID) |
| 453 base::debug::SetCrashKeyValue(crash_keys::kGPUVendorID, |
| 454 base::StringPrintf("0x%04x", gpu_info.gpu.vendor_id)); |
| 455 base::debug::SetCrashKeyValue(crash_keys::kGPUDeviceID, |
| 456 base::StringPrintf("0x%04x", gpu_info.gpu.device_id)); |
| 457 #endif |
| 458 base::debug::SetCrashKeyValue(crash_keys::kGPUDriverVersion, |
| 459 gpu_info.driver_version); |
| 460 base::debug::SetCrashKeyValue(crash_keys::kGPUPixelShaderVersion, |
| 461 gpu_info.pixel_shader_version); |
| 462 base::debug::SetCrashKeyValue(crash_keys::kGPUVertexShaderVersion, |
| 463 gpu_info.vertex_shader_version); |
| 464 #if defined(OS_MACOSX) |
| 465 base::debug::SetCrashKeyValue(crash_keys::kGPUGLVersion, gpu_info.gl_version); |
| 466 #elif defined(OS_POSIX) |
| 467 base::debug::SetCrashKeyValue(crash_keys::kGPUVendor, gpu_info.gl_vendor); |
| 468 base::debug::SetCrashKeyValue(crash_keys::kGPURenderer, gpu_info.gl_renderer); |
| 469 #endif |
454 } | 470 } |
455 | 471 |
456 #if BUILDFLAG(ENABLE_PLUGINS) | 472 #if BUILDFLAG(ENABLE_PLUGINS) |
457 // static | 473 // static |
458 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( | 474 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( |
459 const std::vector<std::unique_ptr<content::PepperPluginInfo>>& plugins) { | 475 const std::vector<std::unique_ptr<content::PepperPluginInfo>>& plugins) { |
460 if (plugins.empty()) | 476 if (plugins.empty()) |
461 return nullptr; | 477 return nullptr; |
462 | 478 |
463 using PluginSortKey = std::tuple<base::Version, bool>; | 479 using PluginSortKey = std::tuple<base::Version, bool>; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 if (!origin_trial_policy_) | 709 if (!origin_trial_policy_) |
694 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 710 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
695 return origin_trial_policy_.get(); | 711 return origin_trial_policy_.get(); |
696 } | 712 } |
697 | 713 |
698 #if defined(OS_ANDROID) | 714 #if defined(OS_ANDROID) |
699 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 715 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
700 return new ChromeMediaClientAndroid(); | 716 return new ChromeMediaClientAndroid(); |
701 } | 717 } |
702 #endif // OS_ANDROID | 718 #endif // OS_ANDROID |
OLD | NEW |