summaryrefslogtreecommitdiffstats
path: root/ui/gfx/platform_font_mac.mm
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-24 21:08:51 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-24 21:08:51 +0000
commit7c6137575c22598d8b78c1d4249a9d29a36deacb (patch)
treeec62dfdcbf6e97b44bb99631404a691669c82631 /ui/gfx/platform_font_mac.mm
parentf2289e78c5f7bc64ef1cf7378a185f14fa4e344c (diff)
downloadchromium_src-7c6137575c22598d8b78c1d4249a9d29a36deacb.zip
chromium_src-7c6137575c22598d8b78c1d4249a9d29a36deacb.tar.gz
chromium_src-7c6137575c22598d8b78c1d4249a9d29a36deacb.tar.bz2
Move |PlatformFont::GetStringWidth()| implementation up into font.cc directly.
Also, add |CanvasSkia::GetStringWidth()| convenience method. BUG=none TEST=none Review URL: http://codereview.chromium.org/9117009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/platform_font_mac.mm')
-rw-r--r--ui/gfx/platform_font_mac.mm10
1 files changed, 1 insertions, 9 deletions
diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm
index ee12a33..898ab57 100644
--- a/ui/gfx/platform_font_mac.mm
+++ b/ui/gfx/platform_font_mac.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -10,7 +10,6 @@
#include "base/memory/scoped_nsobject.h"
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
-#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/font.h"
namespace gfx {
@@ -56,13 +55,6 @@ int PlatformFontMac::GetAverageCharacterWidth() const {
return average_width_;
}
-int PlatformFontMac::GetStringWidth(const string16& text) const {
- int width = 0, height = 0;
- CanvasSkia::SizeStringInt(text, Font(const_cast<PlatformFontMac*>(this)),
- &width, &height, gfx::Canvas::NO_ELLIPSIS);
- return width;
-}
-
int PlatformFontMac::GetExpectedTextWidth(int length) const {
return length * average_width_;
}