diff options
Diffstat (limited to 'base/chrome_application_mac.h')
-rw-r--r-- | base/chrome_application_mac.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/base/chrome_application_mac.h b/base/chrome_application_mac.h new file mode 100644 index 0000000..39ef8b3 --- /dev/null +++ b/base/chrome_application_mac.h @@ -0,0 +1,40 @@ +// 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 BASE_CHROME_APPLICATION_MAC_H_ +#define BASE_CHROME_APPLICATION_MAC_H_ + +#import <AppKit/AppKit.h> + +#include "base/basictypes.h" + +@interface CrApplication : NSApplication { + @private + BOOL handlingSendEvent_; +} +@property(readonly, + getter=isHandlingSendEvent, + nonatomic) BOOL handlingSendEvent; + ++ (NSApplication*)sharedApplication; +@end + +namespace chrome_application_mac { + +// Controls the state of |handlingSendEvent_| in the event loop so that it is +// reset properly. +class ScopedSendingEvent { + public: + explicit ScopedSendingEvent(CrApplication* app); + ~ScopedSendingEvent(); + + private: + CrApplication* app_; + BOOL handling_; + DISALLOW_COPY_AND_ASSIGN(ScopedSendingEvent); +}; + +} // chrome_application_mac + +#endif // BASE_CHROME_APPLICATION_MAC_H_ |