diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 21:14:44 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-08 21:14:44 +0000 |
commit | 992edd121c5c1ccb7e4fe94cccd35a9500079637 (patch) | |
tree | 619d934cacda11c0d196d0391a541c4eb54d81c2 /chrome/browser/cocoa/multi_key_equivalent_button.h | |
parent | 494656dcbf45201c79d1a9387f3e1ecfe0b6d2ad (diff) | |
download | chromium_src-992edd121c5c1ccb7e4fe94cccd35a9500079637.zip chromium_src-992edd121c5c1ccb7e4fe94cccd35a9500079637.tar.gz chromium_src-992edd121c5c1ccb7e4fe94cccd35a9500079637.tar.bz2 |
Hung Renderer dialog should dismiss with "Wait" for Enter or Esc
HungRendererDialog.xib: made the "Wait" button's use Return as its normal key
equivalent; changed the "Wait" button's class to MultiKeyEquivalentButton.
BUG=21074
TEST=about:hang. Return, Enter, Esc, and Command-. (period) should all dismiss
the Hung Renderer dialog with "Wait".
Review URL: http://codereview.chromium.org/266026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28454 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/multi_key_equivalent_button.h')
-rw-r--r-- | chrome/browser/cocoa/multi_key_equivalent_button.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/multi_key_equivalent_button.h b/chrome/browser/cocoa/multi_key_equivalent_button.h new file mode 100644 index 0000000..4d2c3b6 --- /dev/null +++ b/chrome/browser/cocoa/multi_key_equivalent_button.h @@ -0,0 +1,35 @@ +// Copyright (c) 2009 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. + +#ifndef CHROME_BROWSER_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_ +#define CHROME_BROWSER_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_ + +#import <AppKit/AppKit.h> + +#include <vector> + +struct KeyEquivalentAndModifierMask { + public: + KeyEquivalentAndModifierMask() : charCode(nil), mask(0) {} + NSString* charCode; + NSUInteger mask; +}; + +// MultiKeyEquivalentButton is an NSButton subclass that is capable of +// responding to additional key equivalents. It will respond to the ordinary +// NSButton key equivalent set by -setKeyEquivalent: and +// -setKeyEquivalentModifierMask:, and it will also respond to any additional +// equivalents provided to it in a KeyEquivalentAndModifierMask structure +// passed to -addKeyEquivalent:. + +@interface MultiKeyEquivalentButton : NSButton { + @private + std::vector<KeyEquivalentAndModifierMask> extraKeys_; +} + +- (void)addKeyEquivalent:(KeyEquivalentAndModifierMask)key; + +@end + +#endif // CHROME_BROWSER_COCOA_MULTI_KEY_EQUIVALENT_BUTTON_H_ |