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

Side by Side Diff: chrome/common/chrome_application_mac.h

Issue 5950003: Remove CrApplication dependency from base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/base
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/chrome_application_mac.mm » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef BASE_CHROME_APPLICATION_MAC_H_ 5 #ifndef CHROME_COMMON_CHROME_APPLICATION_MAC_H_
6 #define BASE_CHROME_APPLICATION_MAC_H_ 6 #define CHROME_COMMON_CHROME_APPLICATION_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #import <AppKit/AppKit.h> 9 #import <AppKit/AppKit.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/message_pump_mac.h"
12 #include "base/scoped_nsobject.h" 13 #include "base/scoped_nsobject.h"
13 14
14 // Event hooks must implement this protocol. 15 // Event hooks must implement this protocol.
15 @protocol CrApplicationEventHookProtocol 16 @protocol CrApplicationEventHookProtocol
16 - (void)hookForEvent:(NSEvent*)theEvent; 17 - (void)hookForEvent:(NSEvent*)theEvent;
17 @end 18 @end
18 19
19 20
20 @interface CrApplication : NSApplication { 21 @interface CrApplication : NSApplication<CrAppProtocol> {
21 @private 22 @private
22 BOOL handlingSendEvent_; 23 BOOL handlingSendEvent_;
23 // Array of objects implementing the CrApplicationEventHookProtocol 24 // Array of objects implementing the CrApplicationEventHookProtocol
24 scoped_nsobject<NSMutableArray> eventHooks_; 25 scoped_nsobject<NSMutableArray> eventHooks_;
25 } 26 }
26 @property(readonly, 27 - (BOOL)isHandlingSendEvent;
27 getter=isHandlingSendEvent,
28 nonatomic) BOOL handlingSendEvent;
29 28
30 // Add or remove an event hook to be called for every sendEvent: 29 // Add or remove an event hook to be called for every sendEvent:
31 // that the application receives. These handlers are called before 30 // that the application receives. These handlers are called before
32 // the normal [NSApplication sendEvent:] call is made. 31 // the normal [NSApplication sendEvent:] call is made.
33 32
34 // This is not a good alternative to a nested event loop. It should 33 // This is not a good alternative to a nested event loop. It should
35 // be used only when normal event logic and notification breaks down 34 // be used only when normal event logic and notification breaks down
36 // (e.g. when clicking outside a canBecomeKey:NO window to "switch 35 // (e.g. when clicking outside a canBecomeKey:NO window to "switch
37 // context" out of it). 36 // context" out of it).
38 - (void)addEventHook:(id<CrApplicationEventHookProtocol>)hook; 37 - (void)addEventHook:(id<CrApplicationEventHookProtocol>)hook;
(...skipping 12 matching lines...) Expand all
51 ~ScopedSendingEvent(); 50 ~ScopedSendingEvent();
52 51
53 private: 52 private:
54 CrApplication* app_; 53 CrApplication* app_;
55 BOOL handling_; 54 BOOL handling_;
56 DISALLOW_COPY_AND_ASSIGN(ScopedSendingEvent); 55 DISALLOW_COPY_AND_ASSIGN(ScopedSendingEvent);
57 }; 56 };
58 57
59 } // chrome_application_mac 58 } // chrome_application_mac
60 59
61 #endif // BASE_CHROME_APPLICATION_MAC_H_ 60 #endif // CHROME_COMMON_CHROME_APPLICATION_MAC_H_
OLDNEW
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/chrome_application_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698