| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/menu/native_menu_win.h" | 5 #include "views/controls/menu/native_menu_win.h" |
| 6 | 6 |
| 7 #include "app/keyboard_codes.h" |
| 7 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 8 #include "app/l10n_util_win.h" | 9 #include "app/l10n_util_win.h" |
| 9 #include "base/keyboard_codes.h" | |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
| 12 #include "gfx/canvas_skia.h" | 12 #include "gfx/canvas_skia.h" |
| 13 #include "gfx/font.h" | 13 #include "gfx/font.h" |
| 14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
| 15 #include "views/accelerator.h" | 15 #include "views/accelerator.h" |
| 16 #include "views/controls/menu/menu_2.h" | 16 #include "views/controls/menu/menu_2.h" |
| 17 | 17 |
| 18 namespace views { | 18 namespace views { |
| 19 | 19 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 547 } |
| 548 | 548 |
| 549 void NativeMenuWin::UpdateMenuItemInfoForString( | 549 void NativeMenuWin::UpdateMenuItemInfoForString( |
| 550 MENUITEMINFO* mii, | 550 MENUITEMINFO* mii, |
| 551 int model_index, | 551 int model_index, |
| 552 const std::wstring& label) { | 552 const std::wstring& label) { |
| 553 std::wstring formatted = label; | 553 std::wstring formatted = label; |
| 554 menus::MenuModel::ItemType type = model_->GetTypeAt(model_index); | 554 menus::MenuModel::ItemType type = model_->GetTypeAt(model_index); |
| 555 if (type != menus::MenuModel::TYPE_SUBMENU) { | 555 if (type != menus::MenuModel::TYPE_SUBMENU) { |
| 556 // Add accelerator details to the label if provided. | 556 // Add accelerator details to the label if provided. |
| 557 views::Accelerator accelerator(base::VKEY_UNKNOWN, false, false, false); | 557 views::Accelerator accelerator(app::VKEY_UNKNOWN, false, false, false); |
| 558 if (model_->GetAcceleratorAt(model_index, &accelerator)) { | 558 if (model_->GetAcceleratorAt(model_index, &accelerator)) { |
| 559 formatted += L"\t"; | 559 formatted += L"\t"; |
| 560 formatted += accelerator.GetShortcutText(); | 560 formatted += accelerator.GetShortcutText(); |
| 561 } | 561 } |
| 562 } | 562 } |
| 563 | 563 |
| 564 // Update the owned string, since Windows will want us to keep this new | 564 // Update the owned string, since Windows will want us to keep this new |
| 565 // version around. | 565 // version around. |
| 566 items_[model_index]->label = formatted; | 566 items_[model_index]->label = formatted; |
| 567 | 567 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 | 629 |
| 630 //////////////////////////////////////////////////////////////////////////////// | 630 //////////////////////////////////////////////////////////////////////////////// |
| 631 // MenuWrapper, public: | 631 // MenuWrapper, public: |
| 632 | 632 |
| 633 // static | 633 // static |
| 634 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { | 634 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { |
| 635 return new NativeMenuWin(menu->model(), NULL); | 635 return new NativeMenuWin(menu->model(), NULL); |
| 636 } | 636 } |
| 637 | 637 |
| 638 } // namespace views | 638 } // namespace views |
| OLD | NEW |