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 #include "cloud_print/virtual_driver/posix/printer_driver_util_posix.h" | 5 #include "cloud_print/virtual_driver/posix/printer_driver_util_posix.h" |
6 | 6 |
7 #import <ApplicationServices/ApplicationServices.h> | 7 #import <ApplicationServices/ApplicationServices.h> |
8 #import <CoreServices/CoreServices.h> | 8 #import <CoreServices/CoreServices.h> |
9 #import <Foundation/NSAutoreleasePool.h> | 9 #import <Foundation/NSAutoreleasePool.h> |
10 #import <Foundation/NSAppleEventDescriptor.h> | 10 #import <Foundation/NSAppleEventDescriptor.h> |
11 #import <ScriptingBridge/SBApplication.h> | 11 #import <ScriptingBridge/SBApplication.h> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/mac/foundation_util.h" | 14 #include "base/mac/foundation_util.h" |
15 | 15 |
16 #include <cups/backend.h> | 16 #include <cups/backend.h> |
17 | 17 |
18 #include <stdlib.h> | 18 #include <stdlib.h> |
19 #include <string> | 19 #include <string> |
20 | 20 |
21 // Duplicated is content/common/cloud_print_class_mac.h | 21 // Duplicated is chrome/common/cloud_print/cloud_print_class_mac.h |
22 const AEEventClass kAECloudPrintClass = 'GCPp'; | 22 const AEEventClass kAECloudPrintClass = 'GCPp'; |
23 | 23 |
24 namespace cloud_print { | 24 namespace cloud_print { |
25 // Checks to see whether the browser process, whose bundle ID | 25 // Checks to see whether the browser process, whose bundle ID |
26 // is specified by bundle ID, is running. | 26 // is specified by bundle ID, is running. |
27 bool IsBrowserRunning(std::string bundleID) { | 27 bool IsBrowserRunning(std::string bundleID) { |
28 SBApplication* app = [SBApplication applicationWithBundleIdentifier: | 28 SBApplication* app = [SBApplication applicationWithBundleIdentifier: |
29 [NSString stringWithUTF8String:bundleID.c_str()]]; | 29 [NSString stringWithUTF8String:bundleID.c_str()]]; |
30 if ([app isRunning]) { | 30 if ([app isRunning]) { |
31 return true; | 31 return true; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 LOG(ERROR) << GetMacOSStatusErrorString(status); | 119 LOG(ERROR) << GetMacOSStatusErrorString(status); |
120 LOG(ERROR) << GetMacOSStatusCommentString(status); | 120 LOG(ERROR) << GetMacOSStatusCommentString(status); |
121 exit(CUPS_BACKEND_CANCEL); | 121 exit(CUPS_BACKEND_CANCEL); |
122 } | 122 } |
123 | 123 |
124 [pool release]; | 124 [pool release]; |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
128 } // namespace printer_driver_util | 128 } // namespace printer_driver_util |
OLD | NEW |