OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "chrome/service/chrome_service_application_mac.h" | 5 #import "chrome/service/chrome_service_application_mac.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
9 #import "chrome/common/cloud_print/cloud_print_class_mac.h" | 9 #import "chrome/common/cloud_print/cloud_print_class_mac.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 | 11 |
12 @interface ServiceCrApplication () | 12 @interface ServiceApplication () |
13 - (void)setCloudPrintHandler; | 13 - (void)setCloudPrintHandler; |
14 - (void)submitPrint:(NSAppleEventDescriptor*)event; | 14 - (void)submitPrint:(NSAppleEventDescriptor*)event; |
15 @end | 15 @end |
16 | 16 |
17 @implementation ServiceCrApplication | 17 @implementation ServiceApplication |
18 | 18 |
19 -(void)setCloudPrintHandler { | 19 -(void)setCloudPrintHandler { |
Robert Sesek
2011/12/02 17:10:17
nit: space after -
Scott Hess - ex-Googler
2011/12/02 19:15:25
Done.
Whoa, hold the phone ... can you see any re
| |
20 NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager]; | 20 NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager]; |
21 [em setEventHandler:self | 21 [em setEventHandler:self |
22 andSelector:@selector(submitPrint:) | 22 andSelector:@selector(submitPrint:) |
23 forEventClass:cloud_print::kAECloudPrintClass | 23 forEventClass:cloud_print::kAECloudPrintClass |
24 andEventID:cloud_print::kAECloudPrintClass]; | 24 andEventID:cloud_print::kAECloudPrintClass]; |
25 } | 25 } |
26 | 26 |
27 // Event handler for Cloud Print Event. Forwards print job received to Chrome, | 27 // Event handler for Cloud Print Event. Forwards print job received to Chrome, |
28 // launching Chrome if necessary. Used to beat CUPS sandboxing. | 28 // launching Chrome if necessary. Used to beat CUPS sandboxing. |
29 - (void)submitPrint:(NSAppleEventDescriptor*)event { | 29 - (void)submitPrint:(NSAppleEventDescriptor*)event { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 LOG(ERROR) << GetMacOSStatusCommentString(status); | 83 LOG(ERROR) << GetMacOSStatusCommentString(status); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 | 87 |
88 @end | 88 @end |
89 | 89 |
90 | 90 |
91 namespace chrome_service_application_mac { | 91 namespace chrome_service_application_mac { |
92 | 92 |
93 void RegisterServiceCrApp() { | 93 void RegisterServiceApp() { |
94 ServiceCrApplication* var = | 94 ServiceApplication* var = |
95 static_cast<ServiceCrApplication*> | 95 base::mac::ObjCCastStrict<ServiceApplication>( |
96 ([ServiceCrApplication sharedApplication]); | 96 [ServiceApplication sharedApplication]); |
97 [var setCloudPrintHandler]; | 97 [var setCloudPrintHandler]; |
98 } | 98 } |
99 | 99 |
100 } // namespace chrome_service_application_mac | 100 } // namespace chrome_service_application_mac |
101 | 101 |
OLD | NEW |