summaryrefslogtreecommitdiffstats
path: root/ui/gfx/skia_util.h
diff options
context:
space:
mode:
authorrhashimoto@chromium.org <rhashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 17:05:49 +0000
committerrhashimoto@chromium.org <rhashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 17:05:49 +0000
commitd2ec9af2197d396716ae15da9f1e1d27e8877b4c (patch)
tree7161075c7477772cb572a826f996e2d232736e2a /ui/gfx/skia_util.h
parent8227d054171e22971d3688b02d02d9ad548ff12f (diff)
downloadchromium_src-d2ec9af2197d396716ae15da9f1e1d27e8877b4c.zip
chromium_src-d2ec9af2197d396716ae15da9f1e1d27e8877b4c.tar.gz
chromium_src-d2ec9af2197d396716ae15da9f1e1d27e8877b4c.tar.bz2
Apply HIDE_PREFIX to Skia strings on linux without doubling underscores.
On linux, CanvasSkia::DrawStringInt() was removing ampersands (when HIDE_PREFIX flag was set) with gfx::RemoveWindowsStyleAccelerators(), which has the side effect of doubling underscores. This CL replaces the call with code that only strips ampersands (turning doubled ampersands into a single ampersand). BUG=chromium-os:15823 TEST=observe network menu with SSIDs containing underscores and ampersands Review URL: http://codereview.chromium.org/7170025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89845 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/skia_util.h')
-rw-r--r--ui/gfx/skia_util.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/gfx/skia_util.h b/ui/gfx/skia_util.h
index 619ff37..f807979 100644
--- a/ui/gfx/skia_util.h
+++ b/ui/gfx/skia_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -6,6 +6,8 @@
#define UI_GFX_SKIA_UTIL_H_
#pragma once
+#include <string>
+
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkRect.h"
@@ -34,6 +36,10 @@ SkShader* CreateGradientShader(int start_point,
// Returns true if the two bitmaps contain the same pixels.
bool BitmapsAreEqual(const SkBitmap& bitmap1, const SkBitmap& bitmap2);
+// Strip the accelerator char (typically '&') from a menu string. A
+// double accelerator char ('&&') will be converted to a single char.
+std::string RemoveAcceleratorChar(const std::string& s, char accelerator_char);
+
} // namespace gfx;
#endif // UI_GFX_SKIA_UTIL_H_