diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 20:34:30 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 20:34:30 +0000 |
commit | fd6752c1960fa20715729de98d43f9ff64124c1c (patch) | |
tree | 3bd1dfa674aaf2f87559bf130590346b1d6b1519 | |
parent | fadf9cdd69aa5bd50ce55d750c1bb1763abcf968 (diff) | |
download | chromium_src-fd6752c1960fa20715729de98d43f9ff64124c1c.zip chromium_src-fd6752c1960fa20715729de98d43f9ff64124c1c.tar.gz chromium_src-fd6752c1960fa20715729de98d43f9ff64124c1c.tar.bz2 |
[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
-rw-r--r-- | base/chrome_application_mac.h | 2 | ||||
-rw-r--r-- | base/chrome_application_mac.mm | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_view_mac.mm | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/base/chrome_application_mac.h b/base/chrome_application_mac.h index 39ef8b3..d7e7989 100644 --- a/base/chrome_application_mac.h +++ b/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: diff --git a/base/chrome_application_mac.mm b/base/chrome_application_mac.mm index d2d8f9f..cdad4ab 100644 --- a/base/chrome_application_mac.mm +++ b/base/chrome_application_mac.mm @@ -29,7 +29,7 @@ } - (void)sendEvent:(NSEvent*)event { - chrome_application_mac::ScopedSendingEvent sendingEventScoper(self); + chrome_application_mac::ScopedSendingEvent sendingEventScoper; [super sendEvent:event]; } @@ -37,8 +37,9 @@ 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]; } diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index b817315..9a06d66 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -134,8 +134,7 @@ void TabContentsViewMac::StartDragging(const WebDropData& drop_data, // 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. |