| Index: chrome/browser/ui/gtk/menu_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/menu_gtk.cc b/chrome/browser/ui/gtk/menu_gtk.cc
|
| index 36abcf8a2ad9c103a4e196dac5fe69afd48775ca..08d0d3730a52c38dc8aa7240f41b506a1eabab01 100644
|
| --- a/chrome/browser/ui/gtk/menu_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/menu_gtk.cc
|
| @@ -19,10 +19,10 @@
|
| #include "chrome/browser/ui/views/event_utils.h"
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "ui/base/accelerators/accelerator_gtk.h"
|
| +#include "ui/base/gtk/menu_label_accelerator_util.h"
|
| #include "ui/base/models/button_menu_item_model.h"
|
| #include "ui/base/models/menu_model.h"
|
| #include "ui/gfx/gtk_util.h"
|
| -#include "ui/gfx/linux_util.h"
|
| #include "webkit/glue/window_open_disposition.h"
|
|
|
| bool MenuGtk::block_activation_ = false;
|
| @@ -314,7 +314,7 @@ void MenuGtk::ConnectSignalHandlers() {
|
|
|
| GtkWidget* MenuGtk::AppendMenuItemWithLabel(int command_id,
|
| const std::string& label) {
|
| - std::string converted_label = gfx::ConvertAcceleratorsFromWindowsStyle(label);
|
| + std::string converted_label = ui::ConvertAcceleratorsFromWindowsStyle(label);
|
| GtkWidget* menu_item = BuildMenuItemWithLabel(label, command_id);
|
| return AppendMenuItem(command_id, menu_item);
|
| }
|
| @@ -322,14 +322,14 @@ GtkWidget* MenuGtk::AppendMenuItemWithLabel(int command_id,
|
| GtkWidget* MenuGtk::AppendMenuItemWithIcon(int command_id,
|
| const std::string& label,
|
| const SkBitmap& icon) {
|
| - std::string converted_label = gfx::ConvertAcceleratorsFromWindowsStyle(label);
|
| + std::string converted_label = ui::ConvertAcceleratorsFromWindowsStyle(label);
|
| GtkWidget* menu_item = BuildMenuItemWithImage(converted_label, icon);
|
| return AppendMenuItem(command_id, menu_item);
|
| }
|
|
|
| GtkWidget* MenuGtk::AppendCheckMenuItemWithLabel(int command_id,
|
| const std::string& label) {
|
| - std::string converted_label = gfx::ConvertAcceleratorsFromWindowsStyle(label);
|
| + std::string converted_label = ui::ConvertAcceleratorsFromWindowsStyle(label);
|
| GtkWidget* menu_item =
|
| gtk_check_menu_item_new_with_mnemonic(converted_label.c_str());
|
| return AppendMenuItem(command_id, menu_item);
|
| @@ -447,9 +447,8 @@ void MenuGtk::BuildSubmenuFromModel(ui::MenuModel* model, GtkWidget* menu) {
|
| GtkWidget* menu_item = NULL;
|
| for (int i = 0; i < model->GetItemCount(); ++i) {
|
| SkBitmap icon;
|
| - std::string label =
|
| - gfx::ConvertAcceleratorsFromWindowsStyle(
|
| - UTF16ToUTF8(model->GetLabelAt(i)));
|
| + std::string label = ui::ConvertAcceleratorsFromWindowsStyle(
|
| + UTF16ToUTF8(model->GetLabelAt(i)));
|
| bool connect_to_activate = true;
|
|
|
| switch (model->GetTypeAt(i)) {
|
| @@ -531,7 +530,7 @@ void MenuGtk::BuildSubmenuFromModel(ui::MenuModel* model, GtkWidget* menu) {
|
| GtkWidget* MenuGtk::BuildButtonMenuItem(ui::ButtonMenuItemModel* model,
|
| GtkWidget* menu) {
|
| GtkWidget* menu_item = gtk_custom_menu_item_new(
|
| - gfx::RemoveWindowsStyleAccelerators(UTF16ToUTF8(model->label())).c_str());
|
| + ui::RemoveWindowsStyleAccelerators(UTF16ToUTF8(model->label())).c_str());
|
|
|
| // Set up the callback to the model for when it is clicked.
|
| g_object_set_data(G_OBJECT(menu_item), "button-model", model);
|
| @@ -560,7 +559,7 @@ GtkWidget* MenuGtk::BuildButtonMenuItem(ui::ButtonMenuItemModel* model,
|
| } else {
|
| gtk_button_set_label(
|
| GTK_BUTTON(button),
|
| - gfx::RemoveWindowsStyleAccelerators(
|
| + ui::RemoveWindowsStyleAccelerators(
|
| UTF16ToUTF8(model->GetLabelAt(i))).c_str());
|
| }
|
|
|
| @@ -573,7 +572,7 @@ GtkWidget* MenuGtk::BuildButtonMenuItem(ui::ButtonMenuItemModel* model,
|
| model->GetCommandIdAt(i));
|
| gtk_button_set_label(
|
| GTK_BUTTON(button),
|
| - gfx::RemoveWindowsStyleAccelerators(
|
| + ui::RemoveWindowsStyleAccelerators(
|
| UTF16ToUTF8(model->GetLabelAt(i))).c_str());
|
| SetUpButtonShowHandler(button, model, i);
|
| break;
|
| @@ -815,9 +814,8 @@ void MenuGtk::SetButtonItemInfo(GtkWidget* button, gpointer userdata) {
|
| G_OBJECT(button), "button-model-id"));
|
|
|
| if (model->IsItemDynamicAt(index)) {
|
| - std::string label =
|
| - gfx::ConvertAcceleratorsFromWindowsStyle(
|
| - UTF16ToUTF8(model->GetLabelAt(index)));
|
| + std::string label = ui::ConvertAcceleratorsFromWindowsStyle(
|
| + UTF16ToUTF8(model->GetLabelAt(index)));
|
| gtk_button_set_label(GTK_BUTTON(button), label.c_str());
|
| }
|
|
|
| @@ -874,9 +872,8 @@ void MenuGtk::SetMenuItemInfo(GtkWidget* widget, gpointer userdata) {
|
| if (model->IsVisibleAt(id)) {
|
| // Update the menu item label if it is dynamic.
|
| if (model->IsItemDynamicAt(id)) {
|
| - std::string label =
|
| - gfx::ConvertAcceleratorsFromWindowsStyle(
|
| - UTF16ToUTF8(model->GetLabelAt(id)));
|
| + std::string label = ui::ConvertAcceleratorsFromWindowsStyle(
|
| + UTF16ToUTF8(model->GetLabelAt(id)));
|
|
|
| gtk_menu_item_set_label(GTK_MENU_ITEM(widget), label.c_str());
|
| if (GTK_IS_IMAGE_MENU_ITEM(widget)) {
|
|
|