| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 // CanSendWhileSwappedOut) that must be handled by the browser when sent from | 497 // CanSendWhileSwappedOut) that must be handled by the browser when sent from |
| 498 // swapped out renderers. | 498 // swapped out renderers. |
| 499 return false; | 499 return false; |
| 500 } | 500 } |
| 501 | 501 |
| 502 std::string ChromeContentClient::GetProduct() const { | 502 std::string ChromeContentClient::GetProduct() const { |
| 503 return ::GetProduct(); | 503 return ::GetProduct(); |
| 504 } | 504 } |
| 505 | 505 |
| 506 std::string ChromeContentClient::GetUserAgent() const { | 506 std::string ChromeContentClient::GetUserAgent() const { |
| 507 std::string product = GetProduct(); | 507 return ::GetUserAgent(); |
| 508 product += " (Dart)"; | |
| 509 #if defined(OS_ANDROID) | |
| 510 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 511 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) | |
| 512 product += " Mobile"; | |
| 513 #endif | |
| 514 return webkit_glue::BuildUserAgentFromProduct(product); | |
| 515 } | 508 } |
| 516 | 509 |
| 517 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const { | 510 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const { |
| 518 return l10n_util::GetStringUTF16(message_id); | 511 return l10n_util::GetStringUTF16(message_id); |
| 519 } | 512 } |
| 520 | 513 |
| 521 base::StringPiece ChromeContentClient::GetDataResource( | 514 base::StringPiece ChromeContentClient::GetDataResource( |
| 522 int resource_id, | 515 int resource_id, |
| 523 ui::ScaleFactor scale_factor) const { | 516 ui::ScaleFactor scale_factor) const { |
| 524 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 517 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 555 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 548 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 556 return true; | 549 return true; |
| 557 } | 550 } |
| 558 return false; | 551 return false; |
| 559 } | 552 } |
| 560 | 553 |
| 561 std::string ChromeContentClient::GetCarbonInterposePath() const { | 554 std::string ChromeContentClient::GetCarbonInterposePath() const { |
| 562 return std::string(kInterposeLibraryPath); | 555 return std::string(kInterposeLibraryPath); |
| 563 } | 556 } |
| 564 #endif | 557 #endif |
| OLD | NEW |