From 312b5121aadac921a3039111d1350d0594369fb1 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Thu, 17 Jun 2010 15:22:11 +0000 Subject: Tweaks for the merged menu: . makes the menu show the same fonts regardless of whether the item has children. . adds text color to MenuConfig. I'm going to use this for the buttons added to the menu. . Changes TextButton to update text_size_ when the font changes. . Changes TextButton to allow you to specify how accelerators are shown. . Nukes TextButton::OnMousePressed as it's not needed (super implementation does the right thing and updates state the TextButton::OnMousePressed wasn't). . Changes accelerator to have constructor taking keycode and modifiers. BUG=45734 TEST=none Review URL: http://codereview.chromium.org/2833013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50108 0039d316-1c4b-4281-b951-d872f2087c98 --- app/menus/accelerator.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/menus/accelerator.h b/app/menus/accelerator.h index 1d659a4..0cb6279 100644 --- a/app/menus/accelerator.h +++ b/app/menus/accelerator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,13 +14,19 @@ namespace menus { class Accelerator { public: - Accelerator() : key_code_(base::VKEY_UNKNOWN), modifiers_(0) { } - virtual ~Accelerator() { } + Accelerator() : key_code_(base::VKEY_UNKNOWN), modifiers_(0) {} + + Accelerator(base::KeyboardCode keycode, int modifiers) + : key_code_(keycode), + modifiers_(modifiers) {} + Accelerator(const Accelerator& accelerator) { key_code_ = accelerator.key_code_; modifiers_ = accelerator.modifiers_; } + virtual ~Accelerator() {} + Accelerator& operator=(const Accelerator& accelerator) { if (this != &accelerator) { key_code_ = accelerator.key_code_; @@ -54,7 +60,7 @@ class Accelerator { } protected: - // The window keycode (VK_...). + // The keycode (VK_...). base::KeyboardCode key_code_; // The state of the Shift/Ctrl/Alt keys (platform-dependent). -- cgit v1.1