summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-06 23:32:43 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-06 23:32:43 +0000
commitd7de57877613a63e36facbd485245918c1131f61 (patch)
tree164f1422c744e42edd84bb92fe347024ab71ec3c /chrome/service
parent5179b9146ce7029e1daedf8607d2bfae50764e7b (diff)
downloadchromium_src-d7de57877613a63e36facbd485245918c1131f61.zip
chromium_src-d7de57877613a63e36facbd485245918c1131f61.tar.gz
chromium_src-d7de57877613a63e36facbd485245918c1131f61.tar.bz2
[Mac] Remove content/ CrApplication.
Pull the CrAppProtocol autorelease-pool handling down into MessagePumpCrApplication, which is selected at Create() if NSApp implements the right protocol. UsingCrApp() allows clients to confirm the correct setup (unfortunately, synchronizing NSApp initialization and MessagePump::Create() would be intrusive). Also push CrAppProtocol and CrAppControlProtocol implementation into BrowserCrApplication, and reparent that class from NSApplication. Reparent ServiceCrApplication on NSApplication and rename. Remove CrApplication registration from gpu, plugin, and renderer mains. Remove MockCrApp dependency from remoting sample code. BUG=102224 Review URL: http://codereview.chromium.org/8771028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113281 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/chrome_service_application_mac.h10
-rw-r--r--chrome/service/chrome_service_application_mac.mm14
-rw-r--r--chrome/service/service_main.cc8
3 files changed, 16 insertions, 16 deletions
diff --git a/chrome/service/chrome_service_application_mac.h b/chrome/service/chrome_service_application_mac.h
index 554a19f..235c2a8 100644
--- a/chrome/service/chrome_service_application_mac.h
+++ b/chrome/service/chrome_service_application_mac.h
@@ -8,10 +8,10 @@
#ifdef __OBJC__
-#import "content/common/chrome_application_mac.h"
+#import <AppKit/AppKit.h>
// Top level Mac Application for the service process.
-@interface ServiceCrApplication : CrApplication
+@interface ServiceApplication : NSApplication
@end
@@ -19,9 +19,9 @@
namespace chrome_service_application_mac {
-// To be used to instantiate ServiceCrApplication from C++ code.
-void RegisterServiceCrApp();
+// To be used to instantiate ServiceApplication from C++ code.
+void RegisterServiceApp();
+
} // namespace chrome_service_application_mac
#endif // CHROME_SERVICE_CHROME_SERVICE_APPLICATION_MAC_H_
-
diff --git a/chrome/service/chrome_service_application_mac.mm b/chrome/service/chrome_service_application_mac.mm
index 845d9f06..75f6b05 100644
--- a/chrome/service/chrome_service_application_mac.mm
+++ b/chrome/service/chrome_service_application_mac.mm
@@ -9,14 +9,14 @@
#import "chrome/common/cloud_print/cloud_print_class_mac.h"
#include "chrome/common/chrome_switches.h"
-@interface ServiceCrApplication ()
+@interface ServiceApplication ()
- (void)setCloudPrintHandler;
- (void)submitPrint:(NSAppleEventDescriptor*)event;
@end
-@implementation ServiceCrApplication
+@implementation ServiceApplication
--(void)setCloudPrintHandler {
+- (void)setCloudPrintHandler {
NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
[em setEventHandler:self
andSelector:@selector(submitPrint:)
@@ -90,10 +90,10 @@
namespace chrome_service_application_mac {
-void RegisterServiceCrApp() {
- ServiceCrApplication* var =
- static_cast<ServiceCrApplication*>
- ([ServiceCrApplication sharedApplication]);
+void RegisterServiceApp() {
+ ServiceApplication* var =
+ base::mac::ObjCCastStrict<ServiceApplication>(
+ [ServiceApplication sharedApplication]);
[var setCloudPrintHandler];
}
diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc
index 99d6c83..bcde1ba 100644
--- a/chrome/service/service_main.cc
+++ b/chrome/service/service_main.cc
@@ -18,6 +18,10 @@
// Mainline routine for running as the service process.
int ServiceProcessMain(const content::MainFunctionParams& parameters) {
+#if defined(OS_MACOSX)
+ chrome_service_application_mac::RegisterServiceApp();
+#endif
+
MessageLoopForUI main_message_loop;
main_message_loop.set_thread_name("MainThread");
if (parameters.command_line.HasSwitch(switches::kWaitForDebugger)) {
@@ -27,10 +31,6 @@ int ServiceProcessMain(const content::MainFunctionParams& parameters) {
VLOG(1) << "Service process launched: "
<< parameters.command_line.GetCommandLineString();
-#if defined(OS_MACOSX)
- chrome_service_application_mac::RegisterServiceCrApp();
-#endif
-
base::PlatformThread::SetName("CrServiceMain");
// If there is already a service process running, quit now.