| Index: chrome/browser/extensions/extension_menu_manager.cc
|
| ===================================================================
|
| --- chrome/browser/extensions/extension_menu_manager.cc (revision 54953)
|
| +++ chrome/browser/extensions/extension_menu_manager.cc (working copy)
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <algorithm>
|
|
|
| +#include "app/l10n_util.h"
|
| #include "base/logging.h"
|
| #include "base/stl_util-inl.h"
|
| #include "base/string_util.h"
|
| @@ -76,11 +77,16 @@
|
| }
|
|
|
| string16 ExtensionMenuItem::TitleWithReplacement(
|
| - const string16& selection) const {
|
| + const string16& selection, size_t max_length) const {
|
| string16 result = UTF8ToUTF16(title_);
|
| // TODO(asargent) - Change this to properly handle %% escaping so you can
|
| // put "%s" in titles that won't get substituted.
|
| ReplaceSubstringsAfterOffset(&result, 0, ASCIIToUTF16("%s"), selection);
|
| +
|
| + if (result.length() > max_length) {
|
| + result = WideToUTF16(l10n_util::TruncateString(UTF16ToWideHack(result),
|
| + max_length));
|
| + }
|
| return result;
|
| }
|
|
|
|
|