Commit c220144d authored by dpolukhin's avatar dpolukhin Committed by Commit bot

Unescape ampersands in network names on network selection screen

MenuModel escapes all ampersands in menu item labels but on network selection
screen this name used not as real menu item so we need to unescape it back.

BUG=480457
TEST=manual

Review URL: https://codereview.chromium.org/1107343002

Cr-Commit-Position: refs/heads/master@{#327280}
parent 07d3d26d
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <string> #include <string>
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/ui/login_display_host.h"
...@@ -86,7 +88,10 @@ base::ListValue* NetworkMenuWebUI::ConvertMenuModel(ui::MenuModel* model) { ...@@ -86,7 +88,10 @@ base::ListValue* NetworkMenuWebUI::ConvertMenuModel(ui::MenuModel* model) {
id = model->GetCommandIdAt(i); id = model->GetCommandIdAt(i);
base::DictionaryValue* item = new base::DictionaryValue(); base::DictionaryValue* item = new base::DictionaryValue();
item->SetInteger("id", id); item->SetInteger("id", id);
item->SetString("label", model->GetLabelAt(i)); base::string16 label = model->GetLabelAt(i);
ReplaceSubstringsAfterOffset(&label, 0, base::ASCIIToUTF16("&&"),
base::ASCIIToUTF16("&"));
item->SetString("label", label);
gfx::Image icon; gfx::Image icon;
if (model->GetIconAt(i, &icon)) { if (model->GetIconAt(i, &icon)) {
SkBitmap icon_bitmap = icon.ToImageSkia()->GetRepresentation( SkBitmap icon_bitmap = icon.ToImageSkia()->GetRepresentation(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment