summaryrefslogtreecommitdiffstats
path: root/app/gfx
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 19:28:44 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 19:28:44 +0000
commit528c56de01bbbd38788ed6cf8d2eea4c56cbe19e (patch)
treeac4f7a001affd772c4ab89701d3d46109b5f9e19 /app/gfx
parent5c86ada8d84f6e67d17b027d347052ef451241c4 (diff)
downloadchromium_src-528c56de01bbbd38788ed6cf8d2eea4c56cbe19e.zip
chromium_src-528c56de01bbbd38788ed6cf8d2eea4c56cbe19e.tar.gz
chromium_src-528c56de01bbbd38788ed6cf8d2eea4c56cbe19e.tar.bz2
Move the number conversions from string_util to a new file.
Use the base namespace in the new file. Update callers. I removed all wstring variants and also the string->number ones that ignore the return value. That encourages people to write code and forget about error handling. TEST=included unit tests BUG=none Review URL: http://codereview.chromium.org/3056029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gfx')
-rw-r--r--app/gfx/font_util.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/gfx/font_util.cc b/app/gfx/font_util.cc
index b079dd9..61e1b52dd 100644
--- a/app/gfx/font_util.cc
+++ b/app/gfx/font_util.cc
@@ -6,7 +6,7 @@
#include "app/l10n_util.h"
#include "base/logging.h"
-#include "base/string_util.h"
+#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "gfx/font.h"
@@ -15,7 +15,8 @@ namespace gfx {
int GetLocalizedContentsWidthForFont(int col_resource_id,
const gfx::Font& font) {
double chars = 0;
- StringToDouble(WideToUTF8(l10n_util::GetString(col_resource_id)), &chars);
+ base::StringToDouble(WideToUTF8(l10n_util::GetString(col_resource_id)),
+ &chars);
int width = font.GetExpectedTextWidth(static_cast<int>(chars));
DCHECK_GT(width, 0);
return width;
@@ -24,7 +25,8 @@ int GetLocalizedContentsWidthForFont(int col_resource_id,
int GetLocalizedContentsHeightForFont(int row_resource_id,
const gfx::Font& font) {
double lines = 0;
- StringToDouble(WideToUTF8(l10n_util::GetString(row_resource_id)), &lines);
+ base::StringToDouble(WideToUTF8(l10n_util::GetString(row_resource_id)),
+ &lines);
int height = static_cast<int>(font.height() * lines);
DCHECK_GT(height, 0);
return height;