| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
| 9 #include "chrome/common/chrome_version_info.h" | 9 #include "chrome/common/chrome_version_info.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 std::string product("CriOS/"); | 46 std::string product("CriOS/"); |
| 47 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; | 47 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; |
| 48 return product; | 48 return product; |
| 49 } | 49 } |
| 50 | 50 |
| 51 std::string ChromeContentClient::GetUserAgent() const { | 51 std::string ChromeContentClient::GetUserAgent() const { |
| 52 std::string product = GetProduct(); | 52 std::string product = GetProduct(); |
| 53 return webkit_glue::BuildUserAgentFromProduct(product); | 53 return webkit_glue::BuildUserAgentFromProduct(product); |
| 54 } | 54 } |
| 55 | 55 |
| 56 string16 ChromeContentClient::GetLocalizedString(int message_id) const { | 56 base::string16 ChromeContentClient::GetLocalizedString(int message_id) const { |
| 57 return l10n_util::GetStringUTF16(message_id); | 57 return l10n_util::GetStringUTF16(message_id); |
| 58 } | 58 } |
| 59 | 59 |
| 60 base::StringPiece ChromeContentClient::GetDataResource( | 60 base::StringPiece ChromeContentClient::GetDataResource( |
| 61 int resource_id, | 61 int resource_id, |
| 62 ui::ScaleFactor scale_factor) const { | 62 ui::ScaleFactor scale_factor) const { |
| 63 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 63 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
| 64 resource_id, scale_factor); | 64 resource_id, scale_factor); |
| 65 } | 65 } |
| 66 | 66 |
| 67 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( | 67 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( |
| 68 int resource_id) const { | 68 int resource_id) const { |
| 69 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); | 69 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); |
| 70 } | 70 } |
| 71 | 71 |
| 72 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { | 72 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { |
| 73 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); | 73 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); |
| 74 } | 74 } |
| 75 | 75 |
| 76 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) { | 76 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) { |
| 77 DCHECK(false) << "Unknown child process type!"; | 77 DCHECK(false) << "Unknown child process type!"; |
| 78 return "Unknown"; | 78 return "Unknown"; |
| 79 } | 79 } |
| OLD | NEW |