diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 02:07:07 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 02:07:07 +0000 |
commit | f5af06bb328cfce8b20e1a24cfcd8288f5b8dfaf (patch) | |
tree | 8450586a6058f0a2b4f81884de3d84f0f4c9aeb1 | |
parent | 4675db369344e4a4e0dca165f8ab0e2f93b39422 (diff) | |
download | chromium_src-f5af06bb328cfce8b20e1a24cfcd8288f5b8dfaf.zip chromium_src-f5af06bb328cfce8b20e1a24cfcd8288f5b8dfaf.tar.gz chromium_src-f5af06bb328cfce8b20e1a24cfcd8288f5b8dfaf.tar.bz2 |
Removed code related to Mac virtual printer.
BUG=111652,350118
Review URL: https://codereview.chromium.org/193923002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256400 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 31 | ||||
-rw-r--r-- | chrome/chrome.gyp | 2 | ||||
-rw-r--r-- | chrome/service/chrome_service_application_mac.h | 15 | ||||
-rw-r--r-- | chrome/service/chrome_service_application_mac.mm | 85 | ||||
-rw-r--r-- | chrome/service/service_main.cc | 6 |
5 files changed, 0 insertions, 139 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 23f892d..87b473e 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -30,11 +30,9 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/lifetime/application_lifetime.h" -#include "chrome/browser/printing/print_dialog_cloud.h" #include "chrome/browser/profiles/profile_info_cache_observer.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profiles_state.h" -#include "chrome/browser/service_process/service_process_control.h" #include "chrome/browser/sessions/session_restore.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/session_service_factory.h" @@ -78,7 +76,6 @@ #include "chrome/common/mac/app_mode_common.h" #include "chrome/common/pref_names.h" #include "chrome/common/profile_management_switches.h" -#include "chrome/common/service_messages.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_manager.h" @@ -214,7 +211,6 @@ bool IsProfileSignedOut(Profile* profile) { - (void)openUrls:(const std::vector<GURL>&)urls; - (void)getUrl:(NSAppleEventDescriptor*)event withReply:(NSAppleEventDescriptor*)reply; -- (void)submitCloudPrintJob:(NSAppleEventDescriptor*)event; - (void)windowLayeringDidChange:(NSNotification*)inNotification; - (void)activeSpaceDidChange:(NSNotification*)inNotification; - (void)windowChangedToProfile:(Profile*)profile; @@ -290,10 +286,6 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { forEventClass:kInternetEventClass andEventID:kAEGetURL]; [em setEventHandler:self - andSelector:@selector(submitCloudPrintJob:) - forEventClass:cloud_print::kAECloudPrintClass - andEventID:cloud_print::kAECloudPrintClass]; - [em setEventHandler:self andSelector:@selector(getUrl:withReply:) forEventClass:'WWW!' // A particularly ancient AppleEvent that dates andEventID:'OURL']; // back to the Spyglass days. @@ -1337,29 +1329,6 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { [self openUrls:gurlVector]; } -// Apple Event handler that receives print event from service -// process, gets the required data and launches Print dialog. -- (void)submitCloudPrintJob:(NSAppleEventDescriptor*)event { - // Pull parameter list out of Apple Event. - NSAppleEventDescriptor* paramList = - [event paramDescriptorForKeyword:cloud_print::kAECloudPrintClass]; - - if (paramList != nil) { - // Pull required fields out of parameter list. - NSString* mime = [[paramList descriptorAtIndex:1] stringValue]; - NSString* inputPath = [[paramList descriptorAtIndex:2] stringValue]; - NSString* printTitle = [[paramList descriptorAtIndex:3] stringValue]; - NSString* printTicket = [[paramList descriptorAtIndex:4] stringValue]; - // Convert the title to UTF 16 as required. - base::string16 title16 = base::SysNSStringToUTF16(printTitle); - base::string16 printTicket16 = base::SysNSStringToUTF16(printTicket); - print_dialog_cloud::CreatePrintDialogForFile( - ProfileManager::GetActiveUserProfile(), NULL, - base::FilePath([inputPath fileSystemRepresentation]), title16, - printTicket16, [mime UTF8String], /*delete_on_close=*/false); - } -} - - (void)application:(NSApplication*)sender openFiles:(NSArray*)filenames { std::vector<GURL> gurlVector; diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 7504fcc..4265490 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1048,8 +1048,6 @@ '../third_party/libjingle/libjingle.gyp:libjingle', ], 'sources': [ - 'service/chrome_service_application_mac.h', - 'service/chrome_service_application_mac.mm', 'service/cloud_print/cdd_conversion_win.cc', 'service/cloud_print/cdd_conversion_win.h', 'service/cloud_print/cloud_print_auth.cc', diff --git a/chrome/service/chrome_service_application_mac.h b/chrome/service/chrome_service_application_mac.h deleted file mode 100644 index f9d3582..0000000 --- a/chrome/service/chrome_service_application_mac.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_SERVICE_CHROME_SERVICE_APPLICATION_MAC_H_ -#define CHROME_SERVICE_CHROME_SERVICE_APPLICATION_MAC_H_ - -namespace chrome_service_mac { - -// To be used to instantiate kAECloudPrintClass event handler from C++ code. -void RegisterServiceEventHandler(); - -} // namespace chrome_service_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 deleted file mode 100644 index 3b78059..0000000 --- a/chrome/service/chrome_service_application_mac.mm +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "chrome/service/chrome_service_application_mac.h" - -#include "base/mac/foundation_util.h" -#include "base/mac/mac_logging.h" -#include "base/strings/sys_string_conversions.h" -#import "chrome/common/cloud_print/cloud_print_class_mac.h" -#include "chrome/common/chrome_switches.h" - -@interface ServiceEventHandler : NSObject -+ (void)submitPrint:(NSAppleEventDescriptor*)event; -@end - -@implementation ServiceEventHandler - -// Event handler for Cloud Print Event. Forwards print job received to Chrome, -// launching Chrome if necessary. Used to beat CUPS sandboxing. -+ (void)submitPrint:(NSAppleEventDescriptor*)event { - std::string silent = std::string("--") + switches::kNoStartupWindow; - // Set up flag so that it can be passed along with the Apple Event. - base::ScopedCFTypeRef<CFStringRef> silentLaunchFlag( - base::SysUTF8ToCFStringRef(silent)); - CFStringRef flags[] = { silentLaunchFlag }; - // Argv array that will be passed. - base::ScopedCFTypeRef<CFArrayRef> passArgv( - CFArrayCreate(NULL, (const void**)flags, 1, &kCFTypeArrayCallBacks)); - FSRef ref; - // Get Chrome's bundle ID. - std::string bundleID = base::mac::BaseBundleID(); - base::ScopedCFTypeRef<CFStringRef> bundleIDCF( - base::SysUTF8ToCFStringRef(bundleID)); - // Use Launch Services to locate Chrome using its bundleID. - OSStatus status = LSFindApplicationForInfo(kLSUnknownCreator, bundleIDCF, - NULL, &ref, NULL); - - if (status != noErr) { - OSSTATUS_LOG(ERROR, status) << "Failed to make path ref"; - return; - } - // Actually create the Apple Event. - NSAppleEventDescriptor* sendEvent = - [NSAppleEventDescriptor - appleEventWithEventClass:cloud_print::kAECloudPrintClass - eventID:cloud_print::kAECloudPrintClass - targetDescriptor:nil - returnID:kAutoGenerateReturnID - transactionID:kAnyTransactionID]; - // Pull the parameters out of AppleEvent sent to us and attach them - // to our Apple Event. - NSAppleEventDescriptor* parameters = - [event paramDescriptorForKeyword:cloud_print::kAECloudPrintClass]; - [sendEvent setParamDescriptor:parameters - forKeyword:cloud_print::kAECloudPrintClass]; - LSApplicationParameters params = { 0, - kLSLaunchDefaults, - &ref, - NULL, - NULL, - passArgv, - NULL }; - AEDesc* initialEvent = const_cast<AEDesc*>([sendEvent aeDesc]); - params.initialEvent = static_cast<AppleEvent*>(initialEvent); - // Send the Apple Event Using launch services, launching Chrome if necessary. - status = LSOpenApplication(¶ms, NULL); - if (status != noErr) { - OSSTATUS_LOG(ERROR, status) << "Unable to launch"; - } -} - -@end - -namespace chrome_service_mac { - -void RegisterServiceEventHandler() { - NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager]; - [em setEventHandler:[ServiceEventHandler class] - andSelector:@selector(submitPrint:) - forEventClass:cloud_print::kAECloudPrintClass - andEventID:cloud_print::kAECloudPrintClass]; -} - -} // namespace chrome_service_mac diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index e6d0142..e2bc8e7 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc @@ -14,8 +14,6 @@ #if defined(OS_WIN) #include "content/public/common/sandbox_init.h" #include "sandbox/win/src/sandbox_types.h" -#elif defined(OS_MACOSX) -#include "chrome/service/chrome_service_application_mac.h" #endif // defined(OS_WIN) // Mainline routine for running as the service process. @@ -24,10 +22,6 @@ int ServiceProcessMain(const content::MainFunctionParams& parameters) { // cookies should go through the browser process. net::URLRequest::SetDefaultCookiePolicyToBlock(); -#if defined(OS_MACOSX) - chrome_service_mac::RegisterServiceEventHandler(); -#endif - base::MessageLoopForUI main_message_loop; main_message_loop.set_thread_name("MainThread"); if (parameters.command_line.HasSwitch(switches::kWaitForDebugger)) { |