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

Unified Diff: ui/base/cocoa/event_hook_application.h

Issue 11498008: RenderWidget popup should be a NSWindow so it can go outside the main window. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed include Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/cocoa/event_hook_application.h
diff --git a/ui/base/cocoa/event_hook_application.h b/ui/base/cocoa/event_hook_application.h
new file mode 100644
index 0000000000000000000000000000000000000000..b18921a30dffbfa20d221ca628bac335a3e2b314
--- /dev/null
+++ b/ui/base/cocoa/event_hook_application.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 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 UI_BASE_COCOA_EVENT_HOOK_APPLICATION_H_
+#define UI_BASE_COCOA_EVENT_HOOK_APPLICATION_H_
+
+#ifdef __OBJC__
Nico 2012/12/14 19:00:46 nit: we prefer #if defined
+
+#import <AppKit/AppKit.h>
+
+#include <vector>
Nico 2012/12/14 19:00:46 unused
+
+#import "base/memory/scoped_nsobject.h"
+
+// Event hooks must implement this protocol.
+@protocol CrEventHookProtocol
+- (void)hookForEvent:(NSEvent*)theEvent;
+@end
+
+@interface CrEventHookApplication : NSApplication {
Nico 2012/12/14 19:00:46 Add a class comment.
+ @private
+ // Array of objects implementing EventHookProtocol.
+ scoped_nsobject<NSMutableArray> eventHooks_;
+}
+
+// Add or remove an event hook to be called for every sendEvent:
+// that the application receives. These handlers are called before
+// the normal [NSApplication sendEvent:] call is made.
+
+// This is not a good alternative to a nested event loop. It should
+// be used only when normal event logic and notification breaks down
+// (e.g. when clicking outside a canBecomeKey:NO window to "switch
+// context" out of it).
+- (void)addEventHook:(id<CrEventHookProtocol>)hook;
+- (void)removeEventHook:(id<CrEventHookProtocol>)hook;
+
+@end
+
+#endif
Nico 2012/12/14 19:00:46 // defined(__OBJC__)
+
+#endif // UI_BASE_COCOA_EVENT_HOOK_APPLICATION_H_
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | ui/base/cocoa/event_hook_application.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698