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

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

Issue 6134010: Revert 71167 - Remove wstring from gfx.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « views/controls/label_unittest.cc ('k') | views/controls/menu/menu_item_view_gtk.cc » ('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/menu_item_view.h" 5 #include "views/controls/menu/menu_item_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/menus/menu_model.h" 8 #include "app/menus/menu_model.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "gfx/canvas.h" 10 #include "gfx/canvas.h"
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 GetTopMargin(), max_accel_width, available_height); 606 GetTopMargin(), max_accel_width, available_height);
607 accel_bounds.set_x(MirroredLeftPointForRect(accel_bounds)); 607 accel_bounds.set_x(MirroredLeftPointForRect(accel_bounds));
608 int flags = GetRootMenuItem()->GetDrawStringFlags() | 608 int flags = GetRootMenuItem()->GetDrawStringFlags() |
609 gfx::Canvas::TEXT_VALIGN_MIDDLE; 609 gfx::Canvas::TEXT_VALIGN_MIDDLE;
610 flags &= ~(gfx::Canvas::TEXT_ALIGN_RIGHT | gfx::Canvas::TEXT_ALIGN_LEFT); 610 flags &= ~(gfx::Canvas::TEXT_ALIGN_RIGHT | gfx::Canvas::TEXT_ALIGN_LEFT);
611 if (base::i18n::IsRTL()) 611 if (base::i18n::IsRTL())
612 flags |= gfx::Canvas::TEXT_ALIGN_LEFT; 612 flags |= gfx::Canvas::TEXT_ALIGN_LEFT;
613 else 613 else
614 flags |= gfx::Canvas::TEXT_ALIGN_RIGHT; 614 flags |= gfx::Canvas::TEXT_ALIGN_RIGHT;
615 canvas->DrawStringInt( 615 canvas->DrawStringInt(
616 accel_text, font, TextButton::kDisabledColor, 616 UTF16ToWideHack(accel_text), font, TextButton::kDisabledColor,
617 accel_bounds.x(), accel_bounds.y(), accel_bounds.width(), 617 accel_bounds.x(), accel_bounds.y(), accel_bounds.width(),
618 accel_bounds.height(), flags); 618 accel_bounds.height(), flags);
619 } 619 }
620 620
621 void MenuItemView::DestroyAllMenuHosts() { 621 void MenuItemView::DestroyAllMenuHosts() {
622 if (!HasSubmenu()) 622 if (!HasSubmenu())
623 return; 623 return;
624 624
625 submenu_->Close(); 625 submenu_->Close();
626 for (int i = 0, item_count = submenu_->GetMenuItemCount(); i < item_count; 626 for (int i = 0, item_count = submenu_->GetMenuItemCount(); i < item_count;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 } 658 }
659 659
660 string16 MenuItemView::GetAcceleratorText() { 660 string16 MenuItemView::GetAcceleratorText() {
661 Accelerator accelerator; 661 Accelerator accelerator;
662 return (GetDelegate() && 662 return (GetDelegate() &&
663 GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ? 663 GetDelegate()->GetAccelerator(GetCommand(), &accelerator)) ?
664 accelerator.GetShortcutText() : string16(); 664 accelerator.GetShortcutText() : string16();
665 } 665 }
666 666
667 } // namespace views 667 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/label_unittest.cc ('k') | views/controls/menu/menu_item_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698