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

Unified Diff: base/message_pump_mac.h

Issue 8771028: [Mac] Remove content/ CrApplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk for commit-queue. Created 9 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
« no previous file with comments | « no previous file | base/message_pump_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_mac.h
diff --git a/base/message_pump_mac.h b/base/message_pump_mac.h
index 501d8c68d592677aebba8274e875978aa2d0a430..1f7ea10009cb043575913ed50b1f9d39d32789cc 100644
--- a/base/message_pump_mac.h
+++ b/base/message_pump_mac.h
@@ -232,10 +232,6 @@ class MessagePumpNSApplication : public MessagePumpCFRunLoopBase {
virtual void DoRun(Delegate* delegate) OVERRIDE;
virtual void Quit() OVERRIDE;
- protected:
- // Returns nil if NSApp is currently in the middle of calling -sendEvent.
- virtual NSAutoreleasePool* CreateAutoreleasePool() OVERRIDE;
-
private:
// False after Quit is called.
bool keep_running_;
@@ -249,12 +245,42 @@ class MessagePumpNSApplication : public MessagePumpCFRunLoopBase {
DISALLOW_COPY_AND_ASSIGN(MessagePumpNSApplication);
};
+class MessagePumpCrApplication : public MessagePumpNSApplication {
+ public:
+ MessagePumpCrApplication();
+
+ protected:
+ // Returns nil if NSApp is currently in the middle of calling
+ // -sendEvent. Requires NSApp implementing CrAppProtocol.
+ virtual NSAutoreleasePool* CreateAutoreleasePool() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MessagePumpCrApplication);
+};
+
class MessagePumpMac {
public:
- // Returns a new instance of MessagePumpNSApplication if called on the main
- // thread. Otherwise, returns a new instance of MessagePumpNSRunLoop.
+ // If not on the main thread, returns a new instance of
+ // MessagePumpNSRunLoop.
+ //
+ // On the main thread, if NSApp exists and conforms to
+ // CrAppProtocol, creates an instances of MessagePumpCrApplication.
+ //
+ // Otherwise creates an instance of MessagePumpNSApplication using a
+ // default NSApplication.
static MessagePump* Create();
+ // If a pump is created before the required CrAppProtocol is
+ // created, the wrong MessagePump subclass could be used.
+ // UsingCrApp() returns false if the message pump was created before
+ // NSApp was initialized, or if NSApp does not implement
+ // CrAppProtocol. NSApp must be initialized before calling.
+ static bool UsingCrApp();
+
+ // Wrapper to query -[NSApp isHandlingSendEvent] from C++ code.
+ // Requires NSApp to implement CrAppProtocol.
+ static bool IsHandlingSendEvent();
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(MessagePumpMac);
};
« no previous file with comments | « no previous file | base/message_pump_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698