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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/cpu.h" | 8 #include "base/cpu.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/common/chrome_version_info.h" | 22 #include "chrome/common/chrome_version_info.h" |
23 #include "chrome/common/crash_keys.h" | 23 #include "chrome/common/crash_keys.h" |
24 #include "chrome/common/pepper_flash.h" | 24 #include "chrome/common/pepper_flash.h" |
25 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
27 #include "components/nacl/common/nacl_process_type.h" | 27 #include "components/nacl/common/nacl_process_type.h" |
28 #include "content/public/common/content_constants.h" | 28 #include "content/public/common/content_constants.h" |
29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
30 #include "content/public/common/pepper_plugin_info.h" | 30 #include "content/public/common/pepper_plugin_info.h" |
31 #include "content/public/common/url_constants.h" | 31 #include "content/public/common/url_constants.h" |
| 32 #include "content/public/common/user_agent.h" |
32 #include "extensions/common/constants.h" | 33 #include "extensions/common/constants.h" |
33 #include "gpu/config/gpu_info.h" | 34 #include "gpu/config/gpu_info.h" |
34 #include "grit/common_resources.h" | 35 #include "grit/common_resources.h" |
35 #include "ppapi/shared_impl/ppapi_permissions.h" | 36 #include "ppapi/shared_impl/ppapi_permissions.h" |
36 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
37 #include "ui/base/layout.h" | 38 #include "ui/base/layout.h" |
38 #include "ui/base/resource/resource_bundle.h" | 39 #include "ui/base/resource/resource_bundle.h" |
39 #include "webkit/common/user_agent/user_agent_util.h" | |
40 | 40 |
41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. | 41 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. |
42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 42 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
43 | 43 |
44 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
45 #include "base/win/registry.h" | 45 #include "base/win/registry.h" |
46 #include "base/win/windows_version.h" | 46 #include "base/win/windows_version.h" |
47 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
48 #include "components/nacl/common/nacl_sandbox_type_mac.h" | 48 #include "components/nacl/common/nacl_sandbox_type_mac.h" |
49 #endif | 49 #endif |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 std::string GetUserAgent() { | 428 std::string GetUserAgent() { |
429 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 429 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
430 if (command_line->HasSwitch(switches::kUserAgent)) | 430 if (command_line->HasSwitch(switches::kUserAgent)) |
431 return command_line->GetSwitchValueASCII(switches::kUserAgent); | 431 return command_line->GetSwitchValueASCII(switches::kUserAgent); |
432 | 432 |
433 std::string product = GetProduct(); | 433 std::string product = GetProduct(); |
434 #if defined(OS_ANDROID) | 434 #if defined(OS_ANDROID) |
435 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) | 435 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) |
436 product += " Mobile"; | 436 product += " Mobile"; |
437 #endif | 437 #endif |
438 return webkit_glue::BuildUserAgentFromProduct(product); | 438 return content::BuildUserAgentFromProduct(product); |
439 } | 439 } |
440 | 440 |
441 void ChromeContentClient::SetActiveURL(const GURL& url) { | 441 void ChromeContentClient::SetActiveURL(const GURL& url) { |
442 base::debug::SetCrashKeyValue(crash_keys::kActiveURL, | 442 base::debug::SetCrashKeyValue(crash_keys::kActiveURL, |
443 url.possibly_invalid_spec()); | 443 url.possibly_invalid_spec()); |
444 } | 444 } |
445 | 445 |
446 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { | 446 void ChromeContentClient::SetGpuInfo(const gpu::GPUInfo& gpu_info) { |
447 #if !defined(OS_ANDROID) | 447 #if !defined(OS_ANDROID) |
448 base::debug::SetCrashKeyValue(crash_keys::kGPUVendorID, | 448 base::debug::SetCrashKeyValue(crash_keys::kGPUVendorID, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 547 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
548 return true; | 548 return true; |
549 } | 549 } |
550 return false; | 550 return false; |
551 } | 551 } |
552 | 552 |
553 std::string ChromeContentClient::GetCarbonInterposePath() const { | 553 std::string ChromeContentClient::GetCarbonInterposePath() const { |
554 return std::string(kInterposeLibraryPath); | 554 return std::string(kInterposeLibraryPath); |
555 } | 555 } |
556 #endif | 556 #endif |
OLD | NEW |