| 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_util.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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 version_info.ProductNameAndVersionForUserAgent() : std::string(); | 485 version_info.ProductNameAndVersionForUserAgent() : std::string(); |
| 486 } | 486 } |
| 487 | 487 |
| 488 std::string ChromeContentClient::GetUserAgent() const { | 488 std::string ChromeContentClient::GetUserAgent() const { |
| 489 std::string product = GetProduct(); | 489 std::string product = GetProduct(); |
| 490 #if defined(OS_ANDROID) | 490 #if defined(OS_ANDROID) |
| 491 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 491 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 492 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) | 492 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) |
| 493 product += " Mobile"; | 493 product += " Mobile"; |
| 494 #endif | 494 #endif |
| 495 return webkit_glue::BuildUserAgentFromProduct(product); | 495 return content::BuildUserAgentFromProduct(product); |
| 496 } | 496 } |
| 497 | 497 |
| 498 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const { | 498 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const { |
| 499 return l10n_util::GetStringUTF16(message_id); | 499 return l10n_util::GetStringUTF16(message_id); |
| 500 } | 500 } |
| 501 | 501 |
| 502 base::StringPiece ChromeContentClient::GetDataResource( | 502 base::StringPiece ChromeContentClient::GetDataResource( |
| 503 int resource_id, | 503 int resource_id, |
| 504 ui::ScaleFactor scale_factor) const { | 504 ui::ScaleFactor scale_factor) const { |
| 505 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 505 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 536 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 536 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 537 return true; | 537 return true; |
| 538 } | 538 } |
| 539 return false; | 539 return false; |
| 540 } | 540 } |
| 541 | 541 |
| 542 std::string ChromeContentClient::GetCarbonInterposePath() const { | 542 std::string ChromeContentClient::GetCarbonInterposePath() const { |
| 543 return std::string(kInterposeLibraryPath); | 543 return std::string(kInterposeLibraryPath); |
| 544 } | 544 } |
| 545 #endif | 545 #endif |
| OLD | NEW |