Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: views/controls/menu/native_menu_win.cc

Issue 3354005: Re-lands 58186: (Closed)
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « views/controls/menu/native_menu_gtk.cc ('k') | views/controls/native_control.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/controls/menu/native_menu_gtk.cc ('k') | views/controls/native_control.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698