Skip to content
Browse files

[Mac] ScopedSendingEvent finds NSApp by itself.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/385009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31595 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information...
1 parent e90f7a3 commit 6f58a99e95dd2471856d100ea1bbccc7f69a02d0 shess@chromium.org committed
View
2 base/chrome_application_mac.h
@@ -26,7 +26,7 @@ namespace chrome_application_mac {
// reset properly.
class ScopedSendingEvent {
public:
- explicit ScopedSendingEvent(CrApplication* app);
+ ScopedSendingEvent();
~ScopedSendingEvent();
private:
View
7 base/chrome_application_mac.mm
@@ -29,7 +29,7 @@ + (NSApplication*)sharedApplication {
}
- (void)sendEvent:(NSEvent*)event {
- chrome_application_mac::ScopedSendingEvent sendingEventScoper(self);
+ chrome_application_mac::ScopedSendingEvent sendingEventScoper;
[super sendEvent:event];
}
@@ -37,8 +37,9 @@ - (void)sendEvent:(NSEvent*)event {
namespace chrome_application_mac {
-ScopedSendingEvent::ScopedSendingEvent(CrApplication* app) : app_(app) {
- handling_ = [app_ isHandlingSendEvent];
+ScopedSendingEvent::ScopedSendingEvent()
+ : app_(static_cast<CrApplication*>([CrApplication sharedApplication])),
+ handling_([app_ isHandlingSendEvent]) {
[app_ setHandlingSendEvent:YES];
}
View
3 chrome/browser/tab_contents/tab_contents_view_mac.mm
@@ -134,8 +134,7 @@ - (void)closeTabAfterEvent;
// processing -sendEvent:, so Close() is deferred in that case.
// Drags from web content do not come via -sendEvent:, this sets the
// same flag -sendEvent: would.
- chrome_application_mac::ScopedSendingEvent sendingEventScoper(
- static_cast<CrApplication*>([CrApplication sharedApplication]));
+ chrome_application_mac::ScopedSendingEvent sendingEventScoper;
// The drag invokes a nested event loop, arrange to continue
// processing events.

0 comments on commit 6f58a99

Please sign in to comment.
Something went wrong with that request. Please try again.