From 5561c297d069acd3bb71e7c5e60d0268f2344c3d Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 24 Mar 2022 20:09:03 +0000 Subject: [PATCH] Remove Cloud Print virtual_driver code. The virtual Cloud Print printer driver for Windows is useless without a server to send jobs to. Bug: 1162164 Change-Id: Iea4dbce03aa2df8310a699769b3cbf9d44729326 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3490763 Reviewed-by: Alan Screen Reviewed-by: Jochen Eisinger Commit-Queue: Lei Zhang Auto-Submit: Lei Zhang Reviewed-by: Pavol Marko Commit-Queue: Pavol Marko Cr-Commit-Position: refs/heads/main@{#984987} --- .gitignore | 1 - BUILD.gn | 3 - PRESUBMIT.py | 1 - chrome/browser/BUILD.gn | 7 - chrome/browser/local_discovery/OWNERS | 2 +- .../printing/print_dialog_cloud_win.cc | 164 --- .../browser/printing/print_dialog_cloud_win.h | 22 - .../ui/startup/startup_browser_creator.cc | 13 - chrome/common/chrome_switches.cc | 16 - chrome/common/chrome_switches.h | 4 - chrome/tools/build/win/FILES.cfg | 40 - chrome/tools/service_discovery_sniffer/OWNERS | 2 +- cloud_print/BRANDING | 3 - cloud_print/BUILD.gn | 39 - cloud_print/COMMON_METADATA | 3 - cloud_print/DEPS | 4 - cloud_print/DIR_METADATA | 9 - cloud_print/OWNERS | 7 - cloud_print/common/BUILD.gn | 24 - cloud_print/common/win/cloud_print_utils.cc | 62 - cloud_print/common/win/cloud_print_utils.h | 30 - cloud_print/common/win/install_utils.cc | 213 ---- cloud_print/common/win/install_utils.h | 48 - cloud_print/virtual_driver/win/BUILD.gn | 19 - .../virtual_driver/win/gcp_portmon_dll.ver | 3 - .../virtual_driver/win/install/BUILD.gn | 106 -- .../win/install/inf/gcp_driver.gpd | 1034 ----------------- .../win/install/inf/gcp_driver.inf | Bin 13086 -> 0 bytes .../win/install/resources/cloudprint.ico | Bin 73070 -> 0 bytes .../virtual_driver_setup_resources_ar.xtb | 4 - .../virtual_driver_setup_resources_bg.xtb | 4 - .../virtual_driver_setup_resources_bn.xtb | 4 - .../virtual_driver_setup_resources_ca.xtb | 4 - .../virtual_driver_setup_resources_cs.xtb | 4 - .../virtual_driver_setup_resources_da.xtb | 4 - .../virtual_driver_setup_resources_de.xtb | 4 - .../virtual_driver_setup_resources_el.xtb | 4 - .../virtual_driver_setup_resources_en-GB.xtb | 4 - .../virtual_driver_setup_resources_es-419.xtb | 4 - .../virtual_driver_setup_resources_es.xtb | 4 - .../virtual_driver_setup_resources_et.xtb | 4 - .../virtual_driver_setup_resources_fa.xtb | 4 - .../virtual_driver_setup_resources_fi.xtb | 4 - .../virtual_driver_setup_resources_fil.xtb | 4 - .../virtual_driver_setup_resources_fr.xtb | 4 - .../virtual_driver_setup_resources_gu.xtb | 4 - .../virtual_driver_setup_resources_he.xtb | 4 - .../virtual_driver_setup_resources_hi.xtb | 4 - .../virtual_driver_setup_resources_hr.xtb | 4 - .../virtual_driver_setup_resources_hu.xtb | 4 - .../virtual_driver_setup_resources_id.xtb | 4 - .../virtual_driver_setup_resources_it.xtb | 4 - .../virtual_driver_setup_resources_ja.xtb | 4 - .../virtual_driver_setup_resources_kn.xtb | 4 - .../virtual_driver_setup_resources_ko.xtb | 4 - .../virtual_driver_setup_resources_lt.xtb | 4 - .../virtual_driver_setup_resources_lv.xtb | 4 - .../virtual_driver_setup_resources_ml.xtb | 4 - .../virtual_driver_setup_resources_mr.xtb | 4 - .../virtual_driver_setup_resources_ms.xtb | 4 - .../virtual_driver_setup_resources_nl.xtb | 4 - .../virtual_driver_setup_resources_no.xtb | 4 - .../virtual_driver_setup_resources_pl.xtb | 4 - .../virtual_driver_setup_resources_pt-BR.xtb | 4 - .../virtual_driver_setup_resources_pt-PT.xtb | 4 - .../virtual_driver_setup_resources_ro.xtb | 4 - .../virtual_driver_setup_resources_ru.xtb | 4 - .../virtual_driver_setup_resources_sk.xtb | 4 - .../virtual_driver_setup_resources_sl.xtb | 4 - .../virtual_driver_setup_resources_sr.xtb | 4 - .../virtual_driver_setup_resources_sv.xtb | 4 - .../virtual_driver_setup_resources_sw.xtb | 4 - .../virtual_driver_setup_resources_ta.xtb | 4 - .../virtual_driver_setup_resources_te.xtb | 4 - .../virtual_driver_setup_resources_th.xtb | 4 - .../virtual_driver_setup_resources_tr.xtb | 4 - .../virtual_driver_setup_resources_uk.xtb | 4 - .../virtual_driver_setup_resources_vi.xtb | 4 - .../virtual_driver_setup_resources_zh-CN.xtb | 4 - .../virtual_driver_setup_resources_zh-HK.xtb | 4 - .../virtual_driver_setup_resources_zh-TW.xtb | 4 - .../virtual_driver/win/install/setup.cc | 434 ------- .../win/install/virtual_driver_setup_exe.ver | 3 - .../virtual_driver_setup_resources.grd | 140 --- .../virtual_driver/win/port_monitor/BUILD.gn | 102 -- .../win/port_monitor/port_monitor.cc | 683 ----------- .../win/port_monitor/port_monitor.def | 9 - .../win/port_monitor/port_monitor.h | 93 -- .../win/port_monitor/port_monitor_dll.cc | 87 -- .../win/port_monitor/port_monitor_unittest.cc | 246 ---- .../win/port_monitor/spooler_win.h | 100 -- .../win/virtual_driver_consts.cc | 19 - .../win/virtual_driver_consts.h | 16 - .../win/virtual_driver_helpers.cc | 52 - .../win/virtual_driver_helpers.h | 35 - .../policy/resources/policy_templates.json | 2 +- .../grit/testdata/tools/grit/resource_ids | 3 - tools/gritsettings/resource_ids.spec | 5 - .../gritsettings/translation_expectations.pyl | 1 - 99 files changed, 3 insertions(+), 4114 deletions(-) delete mode 100644 chrome/browser/printing/print_dialog_cloud_win.cc delete mode 100644 chrome/browser/printing/print_dialog_cloud_win.h delete mode 100644 cloud_print/BRANDING delete mode 100644 cloud_print/BUILD.gn delete mode 100644 cloud_print/COMMON_METADATA delete mode 100644 cloud_print/DEPS delete mode 100644 cloud_print/DIR_METADATA delete mode 100644 cloud_print/OWNERS delete mode 100644 cloud_print/common/BUILD.gn delete mode 100644 cloud_print/common/win/cloud_print_utils.cc delete mode 100644 cloud_print/common/win/cloud_print_utils.h delete mode 100644 cloud_print/common/win/install_utils.cc delete mode 100644 cloud_print/common/win/install_utils.h delete mode 100644 cloud_print/virtual_driver/win/BUILD.gn delete mode 100644 cloud_print/virtual_driver/win/gcp_portmon_dll.ver delete mode 100644 cloud_print/virtual_driver/win/install/BUILD.gn delete mode 100644 cloud_print/virtual_driver/win/install/inf/gcp_driver.gpd delete mode 100644 cloud_print/virtual_driver/win/install/inf/gcp_driver.inf delete mode 100644 cloud_print/virtual_driver/win/install/resources/cloudprint.ico delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ar.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bg.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bn.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ca.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_cs.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_da.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_de.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_el.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_en-GB.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es-419.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_et.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fa.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fi.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fil.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fr.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_gu.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_he.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hi.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hr.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hu.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_id.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_it.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ja.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_kn.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ko.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lt.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lv.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ml.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_mr.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ms.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_nl.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_no.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pl.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-BR.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-PT.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ro.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ru.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sk.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sl.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sr.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sv.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sw.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ta.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_te.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_th.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_tr.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_uk.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_vi.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-CN.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-HK.xtb delete mode 100644 cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-TW.xtb delete mode 100644 cloud_print/virtual_driver/win/install/setup.cc delete mode 100644 cloud_print/virtual_driver/win/install/virtual_driver_setup_exe.ver delete mode 100644 cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd delete mode 100644 cloud_print/virtual_driver/win/port_monitor/BUILD.gn delete mode 100644 cloud_print/virtual_driver/win/port_monitor/port_monitor.cc delete mode 100644 cloud_print/virtual_driver/win/port_monitor/port_monitor.def delete mode 100644 cloud_print/virtual_driver/win/port_monitor/port_monitor.h delete mode 100644 cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc delete mode 100644 cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc delete mode 100644 cloud_print/virtual_driver/win/port_monitor/spooler_win.h delete mode 100644 cloud_print/virtual_driver/win/virtual_driver_consts.cc delete mode 100644 cloud_print/virtual_driver/win/virtual_driver_consts.h delete mode 100644 cloud_print/virtual_driver/win/virtual_driver_helpers.cc delete mode 100644 cloud_print/virtual_driver/win/virtual_driver_helpers.h diff --git a/.gitignore b/.gitignore index 149a237842298d..e4f6e929ce528d 100644 --- a/.gitignore +++ b/.gitignore @@ -189,7 +189,6 @@ vs-chromium-project.txt /chromeos/profiles/*.afdo.prof /cipd_cache/ /clank -/cloud_print/cloud_print_version_resources.xml /components/chrome_settings_proto_generated_compile.xml /components/cloud_policy_proto_generated_compile.xml /components/gcm_driver.xml diff --git a/BUILD.gn b/BUILD.gn index cefda89843ff3b..5371f24bb9e3b2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -655,7 +655,6 @@ group("gn_all") { "//chrome/installer/setup:setup_unittests", "//chrome/notification_helper:notification_helper_unittests", "//chrome/test:delayloads_unittests", - "//cloud_print:cloud_print_unittests", "//components/wifi:wifi_test", "//components/zucchini", "//net:quic_client", @@ -925,8 +924,6 @@ if (is_win) { "//chrome/installer/gcapi", "//chrome/installer/mini_installer", "//chrome/updater/win:updater_zip", - "//cloud_print", - "//cloud_print/virtual_driver/win/port_monitor:copy_gcp_portmon_binaries", "//components/policy:pack_policy_templates", "//components/zucchini", "//courgette", diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 293cb4c45a6c19..ed7fc6f809a535 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -2298,7 +2298,6 @@ def CheckSpamLogging(input_api, output_api): r"dll_hash_main\.cc$", r"^chrome[\\/]installer[\\/]setup[\\/].*", r"^chromecast[\\/]", - r"^cloud_print[\\/]", r"^components[\\/]browser_watcher[\\/]" r"dump_stability_report_main_win.cc$", r"^components[\\/]media_control[\\/]renderer[\\/]" diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index a19abe33e21e6b..145b5aee6c1d4e 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -6422,13 +6422,6 @@ static_library("browser") { "printing/pwg_raster_converter.cc", "printing/pwg_raster_converter.h", ] - - if (is_win) { - sources += [ - "printing/print_dialog_cloud_win.cc", - "printing/print_dialog_cloud_win.h", - ] - } } else { # Partial - only printing support. sources += [ diff --git a/chrome/browser/local_discovery/OWNERS b/chrome/browser/local_discovery/OWNERS index be0f423b32be52..1967bf567e8eb3 100644 --- a/chrome/browser/local_discovery/OWNERS +++ b/chrome/browser/local_discovery/OWNERS @@ -1 +1 @@ -file://cloud_print/OWNERS +thestig@chromium.org diff --git a/chrome/browser/printing/print_dialog_cloud_win.cc b/chrome/browser/printing/print_dialog_cloud_win.cc deleted file mode 100644 index e1f8dd5204a540..00000000000000 --- a/chrome/browser/printing/print_dialog_cloud_win.cc +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2015 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. - -#include "chrome/browser/printing/print_dialog_cloud_win.h" - -#include -#include - -#include "base/base64.h" -#include "base/bind.h" -#include "base/command_line.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/json/json_writer.h" -#include "base/memory/ref_counted_memory.h" -#include "base/strings/string_util.h" -#include "base/strings/utf_string_conversions.h" -#include "base/task/post_task.h" -#include "base/task/thread_pool.h" -#include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_window.h" -#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" -#include "chrome/common/chrome_switches.h" -#include "components/cloud_devices/common/cloud_devices_urls.h" -#include "components/google/core/common/google_util.h" -#include "content/public/browser/browser_context.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/message_port_provider.h" -#include "content/public/browser/render_frame_host.h" - -namespace print_dialog_cloud { - -namespace { - -// Limit is used only to allocate memory. Cloud has own small limit. -const int kMaxFileSize = 1024 * 1024 * 1024; - -// Sets print data into Cloud Print widget. -class PrintDataSetter : public content::WebContentsObserver { - public: - PrintDataSetter(content::WebContents* web_contents, - scoped_refptr data, - const std::wstring& print_job_title, - const std::wstring& print_ticket, - const std::string& file_type) - : WebContentsObserver(web_contents) { - DCHECK_NE(data->size(), 0u); - std::string base64_data; - base::Base64Encode(base::StringPiece(data->front_as(), data->size()), - &base64_data); - std::string header("data:"); - header.append(file_type); - header.append(";base64,"); - base64_data.insert(0, header); - - base::DictionaryValue message_data; - message_data.SetString("type", "dataUrl"); - message_data.SetString("title", base::AsString16(print_job_title)); - message_data.SetString("content", base64_data); - std::string json_data; - base::JSONWriter::Write(message_data, &json_data); - message_data_ = u"cp-dialog-set-print-document::"; - message_data_.append(base::UTF8ToUTF16(json_data)); - } - - PrintDataSetter(const PrintDataSetter&) = delete; - PrintDataSetter& operator=(const PrintDataSetter&) = delete; - - private: - // Overridden from content::WebContentsObserver: - void DOMContentLoaded(content::RenderFrameHost* render_frame_host) override { - GURL url = web_contents()->GetURL(); - if (cloud_devices::IsCloudPrintURL(url)) { - std::u16string origin = - base::UTF8ToUTF16(url.DeprecatedGetOriginAsURL().spec()); - content::MessagePortProvider::PostMessageToFrame( - web_contents()->GetPrimaryPage(), origin, origin, message_data_); - } - } - - void WebContentsDestroyed() override { delete this; } - - std::u16string message_data_; -}; - -void CreatePrintDialog(content::BrowserContext* browser_context, - const std::wstring& print_job_title, - const std::wstring& print_ticket, - const std::string& file_type, - scoped_refptr data) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - Profile* profile = Profile::FromBrowserContext(browser_context); - chrome::ScopedTabbedBrowserDisplayer displayer(profile); - GURL url = cloud_devices::GetCloudPrintRelativeURL("client/dialog.html"); - content::WebContents* web_contents = - displayer.browser()->OpenURL(content::OpenURLParams( - google_util::AppendGoogleLocaleParam( - url, g_browser_process->GetApplicationLocale()), - content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, - ui::PAGE_TRANSITION_AUTO_BOOKMARK, false)); - if (data && data->size()) { - new PrintDataSetter(web_contents, data, print_job_title, print_ticket, - file_type); - } -} - -scoped_refptr ReadFile( - const base::FilePath& path_to_file) { - scoped_refptr data; - int64_t file_size = 0; - if (base::GetFileSize(path_to_file, &file_size) && file_size != 0) { - if (file_size > kMaxFileSize) { - DLOG(WARNING) << " print data file too large to reserve space"; - return data; - } - std::string file_data; - file_data.reserve(static_cast(file_size)); - if (base::ReadFileToString(path_to_file, &file_data)) - data = base::RefCountedString::TakeString(&file_data); - } - base::DeleteFile(path_to_file); - return data; -} - -void CreatePrintDialogForFile(content::BrowserContext* browser_context, - const base::FilePath& path_to_file, - const std::wstring& print_job_title, - const std::wstring& print_ticket, - const std::string& file_type) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING}, - base::BindOnce(&ReadFile, path_to_file), - base::BindOnce(&CreatePrintDialog, browser_context, print_job_title, - print_ticket, file_type)); -} - -} // namespace - -bool CreatePrintDialogFromCommandLine(Profile* profile, - const base::CommandLine& command_line) { - base::FilePath cloud_print_file = - command_line.GetSwitchValuePath(switches::kCloudPrintFile); - DCHECK(!cloud_print_file.empty()); - if (cloud_print_file.empty()) - return false; - std::wstring print_job_title = - command_line.GetSwitchValueNative(switches::kCloudPrintJobTitle); - std::wstring print_job_print_ticket = - command_line.GetSwitchValueNative(switches::kCloudPrintPrintTicket); - std::string file_type = - command_line.GetSwitchValueASCII(switches::kCloudPrintFileType); - if (file_type.empty()) - file_type = "application/pdf"; - CreatePrintDialogForFile(profile, cloud_print_file, print_job_title, - print_job_print_ticket, file_type); - return true; -} - -} // namespace print_dialog_cloud diff --git a/chrome/browser/printing/print_dialog_cloud_win.h b/chrome/browser/printing/print_dialog_cloud_win.h deleted file mode 100644 index e2a6753575455f..00000000000000 --- a/chrome/browser/printing/print_dialog_cloud_win.h +++ /dev/null @@ -1,22 +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_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_WIN_H_ -#define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_WIN_H_ - -class Profile; - -namespace base { -class CommandLine; -} - -namespace print_dialog_cloud { - -// Parse switches from command_line and display the print dialog as appropriate. -bool CreatePrintDialogFromCommandLine(Profile* profile, - const base::CommandLine& command_line); - -} // namespace print_dialog_cloud - -#endif // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_WIN_H_ diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc index 431e25c97c7f3d..9f5eae3a38d424 100644 --- a/chrome/browser/ui/startup/startup_browser_creator.cc +++ b/chrome/browser/ui/startup/startup_browser_creator.cc @@ -121,9 +121,6 @@ #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/credential_provider/common/gcp_strings.h" -#if BUILDFLAG(ENABLE_PRINT_PREVIEW) -#include "chrome/browser/printing/print_dialog_cloud_win.h" -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) #endif // BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) @@ -860,16 +857,6 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( Profile* privacy_safe_profile = GetPrivateProfileIfRequested(command_line, profile_info); -#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_PRINT_PREVIEW) - // If we are just displaying a print dialog we shouldn't open browser - // windows. - if (command_line.HasSwitch(switches::kCloudPrintFile) && can_use_profile && - print_dialog_cloud::CreatePrintDialogFromCommandLine(privacy_safe_profile, - command_line)) { - silent_launch = true; - } -#endif // BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_PRINT_PREVIEW) - if (command_line.HasSwitch(switches::kValidateCrx)) { if (process_startup == chrome::startup::IsProcessStartup::kNo) { LOG(ERROR) << "chrome is already running; you must close all running " diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 67f93d2e12b96d..360023b755d09f 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -115,22 +115,6 @@ const char kCheckForUpdateIntervalSec[] = "check-for-update-interval"; // Comma-separated list of SSL cipher suites to disable. const char kCipherSuiteBlacklist[] = "cipher-suite-blacklist"; -// Tells chrome to display the cloud print dialog and upload the specified file -// for printing. -const char kCloudPrintFile[] = "cloud-print-file"; - -// Specifies the mime type to be used when uploading data from the file -// referenced by cloud-print-file. Defaults to "application/pdf" if -// unspecified. -const char kCloudPrintFileType[] = "cloud-print-file-type"; - -// Used with kCloudPrintFile to specify a title for the resulting print job. -const char kCloudPrintJobTitle[] = "cloud-print-job-title"; - -// Used with kCloudPrintFile to specify a JSON print ticket for the resulting -// print job. Defaults to null if unspecified. -const char kCloudPrintPrintTicket[] = "cloud-print-print-ticket"; - // Comma-separated list of BrowserThreads that cause browser process to crash if // the given browser thread is not responsive. UI/IO are the BrowserThreads that // are supported. diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index f79266e850ece3..92d1116aa216ee 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -57,10 +57,6 @@ extern const char kAutoSelectDesktopCaptureSource[]; extern const char kAutoSelectTabCaptureSourceByTitle[]; extern const char kCheckForUpdateIntervalSec[]; extern const char kCipherSuiteBlacklist[]; -extern const char kCloudPrintFile[]; -extern const char kCloudPrintFileType[]; -extern const char kCloudPrintJobTitle[]; -extern const char kCloudPrintPrintTicket[]; extern const char kCrashOnHangThreads[]; extern const char kCreateBrowserOnStartupForTests[]; extern const char kCustomDevtoolsFrontend[]; diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg index d854644247e35e..e9d32574cae187 100644 --- a/chrome/tools/build/win/FILES.cfg +++ b/chrome/tools/build/win/FILES.cfg @@ -558,46 +558,6 @@ FILES = [ 'archive': 'gcp_installer.exe', 'filegroup': ['symsrc'], }, - # Cloud Print files: - { - 'filename': 'gcp_portmon.dll', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - 'filegroup': ['symsrc'], - }, - { - 'filename': 'gcp_portmon.dll.pdb', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - 'optional': ['official'], - }, - { - 'filename': 'gcp_portmon64.dll', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - 'filegroup': ['symsrc'], - }, - { - 'filename': 'gcp_driver.inf', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - }, - { - 'filename': 'gcp_driver.gpd', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - }, - { - 'filename': 'virtual_driver_setup.exe', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - 'filegroup': ['symsrc'], - }, - { - 'filename': 'virtual_driver_setup.exe.pdb', - 'buildtype': ['official'], - 'archive': 'cloud_print.zip', - }, # Test binaries for external QA: { 'filename': 'interactive_ui_tests.exe', diff --git a/chrome/tools/service_discovery_sniffer/OWNERS b/chrome/tools/service_discovery_sniffer/OWNERS index be0f423b32be52..1967bf567e8eb3 100644 --- a/chrome/tools/service_discovery_sniffer/OWNERS +++ b/chrome/tools/service_discovery_sniffer/OWNERS @@ -1 +1 @@ -file://cloud_print/OWNERS +thestig@chromium.org diff --git a/cloud_print/BRANDING b/cloud_print/BRANDING deleted file mode 100644 index 0ab41dae5ae17f..00000000000000 --- a/cloud_print/BRANDING +++ /dev/null @@ -1,3 +0,0 @@ -PRODUCT_FULLNAME=Google Cloud Print -PRODUCT_SHORTNAME=GCP -PRODUCT_DESCRIPTION=Google Cloud Print (GCP) enables any app on any device to print to any cloud-connected printer. diff --git a/cloud_print/BUILD.gn b/cloud_print/BUILD.gn deleted file mode 100644 index 6f855cba8f14c5..00000000000000 --- a/cloud_print/BUILD.gn +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2015 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("//testing/test.gni") - -group("cloud_print") { - if (is_win) { - public_deps = [ - "//cloud_print/virtual_driver/win/install:virtual_driver_setup", - "//cloud_print/virtual_driver/win/port_monitor", - ] - - # When compiling 32-bit, also reference the 64-bit driver for installing on - # 64-bit systems. - if (target_cpu == "x86" && current_cpu == "x86") { - if (is_clang) { - win64 = "//build/toolchain/win:win_clang_x64" - } else { - win64 = "//build/toolchain/win:x64" - } - public_deps += [ "//cloud_print/virtual_driver/win/port_monitor($win64)" ] - } - } -} - -test("cloud_print_unittests") { - sources = [ "virtual_driver/win/port_monitor/port_monitor_unittest.cc" ] - - deps = [ - "//base", - "//base/test:run_all_unittests", - "//cloud_print/virtual_driver/win/port_monitor:lib", - "//testing/gmock", - "//testing/gtest", - ] - - libs = [ "secur32.lib" ] -} diff --git a/cloud_print/COMMON_METADATA b/cloud_print/COMMON_METADATA deleted file mode 100644 index c3c4f77b5f9fe2..00000000000000 --- a/cloud_print/COMMON_METADATA +++ /dev/null @@ -1,3 +0,0 @@ -monorail { - component: "Services>CloudPrint" -} \ No newline at end of file diff --git a/cloud_print/DEPS b/cloud_print/DEPS deleted file mode 100644 index 51643dee59999c..00000000000000 --- a/cloud_print/DEPS +++ /dev/null @@ -1,4 +0,0 @@ -include_rules = [ - "+chrome/common", - "+chrome/installer/launcher_support", -] diff --git a/cloud_print/DIR_METADATA b/cloud_print/DIR_METADATA deleted file mode 100644 index 5a10f9d36e9f20..00000000000000 --- a/cloud_print/DIR_METADATA +++ /dev/null @@ -1,9 +0,0 @@ -# Metadata information for this directory. -# -# For more information on DIR_METADATA files, see: -# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md -# -# For the schema of this file, see Metadata message: -# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto - -mixins: "//cloud_print/COMMON_METADATA" diff --git a/cloud_print/OWNERS b/cloud_print/OWNERS deleted file mode 100644 index 923d7cd8cd7e35..00000000000000 --- a/cloud_print/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -set noparent - -# Cloud Print is temporarily owned by the Chrome Print team. -file://printing/OWNERS - -# Translation artifacts: -per-file ....xtb=file://tools/translation/TRANSLATION_OWNERS diff --git a/cloud_print/common/BUILD.gn b/cloud_print/common/BUILD.gn deleted file mode 100644 index 258cc4e28321f7..00000000000000 --- a/cloud_print/common/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2015 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. - -source_set("common") { - sources = [ - "win/cloud_print_utils.cc", - "win/cloud_print_utils.h", - ] - - deps = [ "//base" ] -} - -source_set("install_utils") { - sources = [ - "win/install_utils.cc", - "win/install_utils.h", - ] - - deps = [ - ":common", - "//base", - ] -} diff --git a/cloud_print/common/win/cloud_print_utils.cc b/cloud_print/common/win/cloud_print_utils.cc deleted file mode 100644 index c1d52ca01c2841..00000000000000 --- a/cloud_print/common/win/cloud_print_utils.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2013 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. - -#include "cloud_print/common/win/cloud_print_utils.h" - -#include - -#include "base/logging.h" -#include "base/win/registry.h" - -namespace cloud_print { - -namespace { - -// Google Update related constants. -const wchar_t kClientStateKey[] = L"SOFTWARE\\Google\\Update\\ClientState\\"; -const wchar_t* kUsageKey = L"dr"; - -} // namespace - -HRESULT GetLastHResult() { - DWORD error_code = GetLastError(); - return error_code ? HRESULT_FROM_WIN32(error_code) : E_FAIL; -} - -std::wstring LoadLocalString(DWORD id) { - static wchar_t dummy = L'\0'; - HMODULE module = NULL; - ::GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | - GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, - &dummy, &module); - LPCWSTR buffer = NULL; - // If the last parameter is 0, LoadString assume that 3rd parameter type is - // LPCWSTR* and assign pointer to read-only memory with resource. - int count = ::LoadString(module, id, reinterpret_cast(&buffer), 0); - if (!buffer) - return std::wstring(); - return std::wstring(buffer, buffer + count); -} - -std::wstring GetErrorMessage(HRESULT hr) { - LPWSTR buffer = NULL; - ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_ALLOCATE_BUFFER, - 0, hr, 0, reinterpret_cast(&buffer), 0, NULL); - std::wstring result(buffer); - ::LocalFree(buffer); - return result; -} - -void SetGoogleUpdateUsage(const std::wstring& product_id) { - // Set appropriate key to 1 to let Omaha record usage. - base::win::RegKey key; - if (key.Create(HKEY_CURRENT_USER, (kClientStateKey + product_id).c_str(), - KEY_SET_VALUE) != ERROR_SUCCESS || - key.WriteValue(kUsageKey, L"1") != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to set usage key"; - } -} - -} // namespace cloud_print diff --git a/cloud_print/common/win/cloud_print_utils.h b/cloud_print/common/win/cloud_print_utils.h deleted file mode 100644 index 0d5d4b088a362e..00000000000000 --- a/cloud_print/common/win/cloud_print_utils.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2013 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 CLOUD_PRINT_COMMON_WIN_CLOUD_PRINT_UTILS_H_ -#define CLOUD_PRINT_COMMON_WIN_CLOUD_PRINT_UTILS_H_ - -#include - -#include - - -namespace cloud_print { - -// Similar to the Windows API call GetLastError but returns an HRESULT. -HRESULT GetLastHResult(); - -// Convert an HRESULT to a localized string. -std::wstring GetErrorMessage(HRESULT hr); - -// Retrieves a string from the string table of the module that contains the -// calling code. -std::wstring LoadLocalString(DWORD id); - -// Sets registry value to notify Google Update that product was used. -void SetGoogleUpdateUsage(const std::wstring& product_id); - -} // namespace cloud_print - -#endif // CLOUD_PRINT_COMMON_WIN_CLOUD_PRINT_UTILS_H_ diff --git a/cloud_print/common/win/install_utils.cc b/cloud_print/common/win/install_utils.cc deleted file mode 100644 index 5ba9db48a41d69..00000000000000 --- a/cloud_print/common/win/install_utils.cc +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2013 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. - -#include "cloud_print/common/win/install_utils.h" - -#include - -#include "base/command_line.h" -#include "base/file_version_info.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/process/launch.h" -#include "base/strings/string_util.h" -#include "base/win/current_module.h" -#include "base/win/registry.h" -#include "cloud_print/common/win/cloud_print_utils.h" - -namespace cloud_print { - -namespace { - -// Google Update related constants. -const wchar_t kClientsKey[] = L"SOFTWARE\\Google\\Update\\Clients\\"; -const wchar_t kClientStateKey[] = L"SOFTWARE\\Google\\Update\\ClientState\\"; -const wchar_t kVersionKey[] = L"pv"; -const wchar_t kNameKey[] = L"name"; - -enum InstallerResult { - INSTALLER_RESULT_FAILED_CUSTOM_ERROR = 1, - INSTALLER_RESULT_FAILED_SYSTEM_ERROR = 3, -}; - -const wchar_t kRegValueInstallerResult[] = L"InstallerResult"; -const wchar_t kRegValueInstallerResultUIString[] = L"InstallerResultUIString"; -const wchar_t kRegValueInstallerError[] = L"InstallerError"; - -// Uninstall related constants. -const wchar_t kUninstallKey[] = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"; -const wchar_t kInstallLocation[] = L"InstallLocation"; -const wchar_t kUninstallString[] = L"UninstallString"; -const wchar_t kDisplayVersion[] = L"DisplayVersion"; -const wchar_t kDisplayIcon[] = L"DisplayIcon"; -const wchar_t kDisplayName[] = L"DisplayName"; -const wchar_t kPublisher[] = L"Publisher"; -const wchar_t kNoModify[] = L"NoModify"; -const wchar_t kNoRepair[] = L"NoRepair"; - -} // namespace - -void SetGoogleUpdateKeys(const std::wstring& product_id, - const std::wstring& product_name) { - base::win::RegKey key; - if (key.Create(HKEY_LOCAL_MACHINE, - (cloud_print::kClientsKey + product_id).c_str(), - KEY_SET_VALUE) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to open key"; - } - - // Get the version from the resource file. - std::wstring version_string; - std::unique_ptr version_info = - FileVersionInfo::CreateFileVersionInfoForModule(CURRENT_MODULE()); - if (version_info) { - version_string = base::AsWString(version_info->product_version()); - } else { - LOG(ERROR) << "Unable to get version string"; - // Use a random version string so that Google Update has something to go by. - version_string = L"0.0.0.99"; - } - - if (key.WriteValue(kVersionKey, version_string.c_str()) != ERROR_SUCCESS || - key.WriteValue(kNameKey, product_name.c_str()) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to set registry keys"; - } -} - -void SetGoogleUpdateError(const std::wstring& product_id, - const std::wstring& message) { - LOG(ERROR) << message; - base::win::RegKey key; - if (key.Create(HKEY_LOCAL_MACHINE, - (cloud_print::kClientStateKey + product_id).c_str(), - KEY_SET_VALUE) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to open key"; - } - - if (key.WriteValue(kRegValueInstallerResult, - INSTALLER_RESULT_FAILED_CUSTOM_ERROR) != ERROR_SUCCESS || - key.WriteValue(kRegValueInstallerResultUIString, message.c_str()) != - ERROR_SUCCESS) { - LOG(ERROR) << "Unable to set registry keys"; - } -} - -void SetGoogleUpdateError(const std::wstring& product_id, HRESULT hr) { - LOG(ERROR) << cloud_print::GetErrorMessage(hr); - base::win::RegKey key; - if (key.Create(HKEY_LOCAL_MACHINE, - (cloud_print::kClientStateKey + product_id).c_str(), - KEY_SET_VALUE) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to open key"; - } - - if (key.WriteValue(kRegValueInstallerResult, - INSTALLER_RESULT_FAILED_SYSTEM_ERROR) != ERROR_SUCCESS || - key.WriteValue(kRegValueInstallerError, hr) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to set registry keys"; - } -} - -void DeleteGoogleUpdateKeys(const std::wstring& product_id) { - base::win::RegKey key; - if (key.Open(HKEY_LOCAL_MACHINE, - (cloud_print::kClientsKey + product_id).c_str(), - DELETE) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to open key to delete"; - return; - } - if (key.DeleteKey(L"") != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to delete key"; - } -} - -void CreateUninstallKey(const std::wstring& uninstall_id, - const std::wstring& product_name, - const std::string& uninstall_switch) { - // Now write the Windows Uninstall entries - // Minimal error checking here since the install can continue - // if this fails. - base::win::RegKey key; - if (key.Create(HKEY_LOCAL_MACHINE, - (cloud_print::kUninstallKey + uninstall_id).c_str(), - KEY_SET_VALUE) != ERROR_SUCCESS) { - LOG(ERROR) << "Unable to open key"; - return; - } - - base::FilePath unstall_binary; - CHECK(base::PathService::Get(base::FILE_EXE, &unstall_binary)); - - base::CommandLine uninstall_command(unstall_binary); - uninstall_command.AppendSwitch(uninstall_switch); - key.WriteValue(kUninstallString, - uninstall_command.GetCommandLineString().c_str()); - key.WriteValue(kInstallLocation, unstall_binary.DirName().value().c_str()); - - // Get the version resource. - std::unique_ptr version_info = - FileVersionInfo::CreateFileVersionInfoForModule(CURRENT_MODULE()); - - if (version_info) { - key.WriteValue(kDisplayVersion, - base::as_wcstr(version_info->file_version())); - key.WriteValue(kPublisher, base::as_wcstr(version_info->company_name())); - } else { - LOG(ERROR) << "Unable to get version string"; - } - key.WriteValue(kDisplayName, product_name.c_str()); - key.WriteValue(kDisplayIcon, unstall_binary.value().c_str()); - key.WriteValue(kNoModify, 1); - key.WriteValue(kNoRepair, 1); -} - -void DeleteUninstallKey(const std::wstring& uninstall_id) { - ::RegDeleteKey(HKEY_LOCAL_MACHINE, - (cloud_print::kUninstallKey + uninstall_id).c_str()); -} - -base::FilePath GetInstallLocation(const std::wstring& uninstall_id) { - base::win::RegKey key; - if (key.Open(HKEY_LOCAL_MACHINE, - (cloud_print::kUninstallKey + uninstall_id).c_str(), - KEY_QUERY_VALUE) != ERROR_SUCCESS) { - // Not installed. - return base::FilePath(); - } - std::wstring install_path_value; - key.ReadValue(kInstallLocation, &install_path_value); - return base::FilePath(install_path_value); -} - -void DeleteProgramDir(const std::string& delete_switch) { - base::FilePath installer_source; - if (!base::PathService::Get(base::FILE_EXE, &installer_source)) - return; - // Deletes only subdirs of program files. - if (!IsProgramsFilesParent(installer_source)) - return; - base::FilePath temp_path; - if (!base::CreateTemporaryFile(&temp_path)) - return; - base::CopyFile(installer_source, temp_path); - base::DeleteFileAfterReboot(temp_path); - base::CommandLine command_line(temp_path); - command_line.AppendSwitchPath(delete_switch, installer_source.DirName()); - base::LaunchOptions options; - if (!base::LaunchProcess(command_line, options).IsValid()) { - LOG(ERROR) << "Unable to launch child uninstall."; - } -} - -bool IsProgramsFilesParent(const base::FilePath& path) { - base::FilePath program_files; - if (!base::PathService::Get(base::DIR_PROGRAM_FILESX86, &program_files)) - return false; - return program_files.IsParent(path); -} - -} // namespace cloud_print diff --git a/cloud_print/common/win/install_utils.h b/cloud_print/common/win/install_utils.h deleted file mode 100644 index ec6a6a9397fbb0..00000000000000 --- a/cloud_print/common/win/install_utils.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2013 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 CLOUD_PRINT_COMMON_WIN_INSTALL_UTILS_H_ -#define CLOUD_PRINT_COMMON_WIN_INSTALL_UTILS_H_ - -#include -#include - -#include "base/files/file_path.h" - -namespace cloud_print { - -// Sets Google Update registry keys after install or update. -void SetGoogleUpdateKeys(const std::wstring& product_id, - const std::wstring& product_name); - -// Sets custom error message to show by Google Update installer -void SetGoogleUpdateError(const std::wstring& product_id, - const std::wstring& message); - -// Sets custom system error code to show by Google Update installer -void SetGoogleUpdateError(const std::wstring& product_id, HRESULT hr); - -// Deletes Google Update reg keys on product uninstall. -void DeleteGoogleUpdateKeys(const std::wstring& product_id); - -// Creates control panel uninstall item. -void CreateUninstallKey(const std::wstring& uninstall_id, - const std::wstring& product_name, - const std::string& uninstall_switch); - -// Deletes control panel uninstall item. -void DeleteUninstallKey(const std::wstring& uninstall_id); - -// Returns install location retrieved from control panel uninstall key. -base::FilePath GetInstallLocation(const std::wstring& uninstall_id); - -// Returns install location retrieved from control panel uninstall key. -void DeleteProgramDir(const std::string& delete_switch); - -// Returns true if path is part of program files. -bool IsProgramsFilesParent(const base::FilePath& path); - -} // namespace cloud_print - -#endif // CLOUD_PRINT_COMMON_WIN_INSTALL_UTILS_H_ diff --git a/cloud_print/virtual_driver/win/BUILD.gn b/cloud_print/virtual_driver/win/BUILD.gn deleted file mode 100644 index 110b5a36f0272f..00000000000000 --- a/cloud_print/virtual_driver/win/BUILD.gn +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2015 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. - -assert(is_win) - -source_set("win") { - sources = [ - "virtual_driver_consts.cc", - "virtual_driver_consts.h", - "virtual_driver_helpers.cc", - "virtual_driver_helpers.h", - ] - - deps = [ - "//base", - "//cloud_print/common", - ] -} diff --git a/cloud_print/virtual_driver/win/gcp_portmon_dll.ver b/cloud_print/virtual_driver/win/gcp_portmon_dll.ver deleted file mode 100644 index dd75a0f13cc418..00000000000000 --- a/cloud_print/virtual_driver/win/gcp_portmon_dll.ver +++ /dev/null @@ -1,3 +0,0 @@ -INTERNAL_NAME=gcp_portmon.dll -ORIGINAL_FILENAME=gcp_portmon.dll -FILETYPE=0x2L diff --git a/cloud_print/virtual_driver/win/install/BUILD.gn b/cloud_print/virtual_driver/win/install/BUILD.gn deleted file mode 100644 index 3359f20569498c..00000000000000 --- a/cloud_print/virtual_driver/win/install/BUILD.gn +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 2015 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/process_version_rc_template.gni") -import("//tools/grit/grit_rule.gni") - -assert(is_win) - -executable("virtual_driver_setup") { - sources = [ "setup.cc" ] - - configs -= [ "//build/config/win:console" ] - configs += [ "//build/config/win:windowed" ] - - deps = [ - ":copy_gcp_driver_gpd", - ":copy_gcp_driver_inf", - ":resources", - ":setup_version", - "//base", - "//cloud_print/common", - "//cloud_print/common:install_utils", - "//cloud_print/virtual_driver/win", - ] - - libs = [ "setupapi.lib" ] - ldflags = [ "/DELAYLOAD:winspool.drv" ] -} - -copy("copy_gcp_driver_gpd") { - sources = [ "inf/gcp_driver.gpd" ] - outputs = [ "$root_build_dir/gcp_driver.gpd" ] -} - -copy("copy_gcp_driver_inf") { - sources = [ "inf/gcp_driver.inf" ] - outputs = [ "$root_build_dir/gcp_driver.inf" ] -} - -process_version_rc_template("setup_version") { - sources = [ "virtual_driver_setup_exe.ver" ] - output = "$target_gen_dir/virtual_driver_setup.rc" -} - -grit("resources") { - visibility = [ ":*" ] - - source = "virtual_driver_setup_resources.grd" - - outputs = [ - "grit/virtual_driver_setup_resources.h", - "virtual_driver_setup_resources_ar.rc", - "virtual_driver_setup_resources_bg.rc", - "virtual_driver_setup_resources_bn.rc", - "virtual_driver_setup_resources_ca.rc", - "virtual_driver_setup_resources_cs.rc", - "virtual_driver_setup_resources_da.rc", - "virtual_driver_setup_resources_de.rc", - "virtual_driver_setup_resources_el.rc", - "virtual_driver_setup_resources_en.rc", - "virtual_driver_setup_resources_en-GB.rc", - "virtual_driver_setup_resources_es.rc", - "virtual_driver_setup_resources_es-419.rc", - "virtual_driver_setup_resources_et.rc", - "virtual_driver_setup_resources_fa.rc", - "virtual_driver_setup_resources_fi.rc", - "virtual_driver_setup_resources_fil.rc", - "virtual_driver_setup_resources_fr.rc", - "virtual_driver_setup_resources_gu.rc", - "virtual_driver_setup_resources_he.rc", - "virtual_driver_setup_resources_hi.rc", - "virtual_driver_setup_resources_hr.rc", - "virtual_driver_setup_resources_hu.rc", - "virtual_driver_setup_resources_id.rc", - "virtual_driver_setup_resources_it.rc", - "virtual_driver_setup_resources_ja.rc", - "virtual_driver_setup_resources_kn.rc", - "virtual_driver_setup_resources_ko.rc", - "virtual_driver_setup_resources_lt.rc", - "virtual_driver_setup_resources_lv.rc", - "virtual_driver_setup_resources_ml.rc", - "virtual_driver_setup_resources_mr.rc", - "virtual_driver_setup_resources_ms.rc", - "virtual_driver_setup_resources_nl.rc", - "virtual_driver_setup_resources_nb.rc", - "virtual_driver_setup_resources_pl.rc", - "virtual_driver_setup_resources_pt-BR.rc", - "virtual_driver_setup_resources_pt-PT.rc", - "virtual_driver_setup_resources_ro.rc", - "virtual_driver_setup_resources_ru.rc", - "virtual_driver_setup_resources_sk.rc", - "virtual_driver_setup_resources_sl.rc", - "virtual_driver_setup_resources_sr.rc", - "virtual_driver_setup_resources_sv.rc", - "virtual_driver_setup_resources_sw.rc", - "virtual_driver_setup_resources_ta.rc", - "virtual_driver_setup_resources_te.rc", - "virtual_driver_setup_resources_th.rc", - "virtual_driver_setup_resources_tr.rc", - "virtual_driver_setup_resources_uk.rc", - "virtual_driver_setup_resources_vi.rc", - "virtual_driver_setup_resources_zh-CN.rc", - "virtual_driver_setup_resources_zh-TW.rc", - ] -} diff --git a/cloud_print/virtual_driver/win/install/inf/gcp_driver.gpd b/cloud_print/virtual_driver/win/install/inf/gcp_driver.gpd deleted file mode 100644 index 3e853d68c8aa25..00000000000000 --- a/cloud_print/virtual_driver/win/install/inf/gcp_driver.gpd +++ /dev/null @@ -1,1034 +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. - -*GPDFileVersion: "1.0" -*GPDSpecVersion: "1.0" -*Include: "StdNames.gpd" -*ResourceDLL: "unires.dll" -*ModelName: "Google Cloud Printer" -*MasterUnits: PAIR(1200, 1200) -*MaxCopies: 1 -*PrintRatePPM: 200 -*PrinterType: PAGE -*IsXPSDriver?: TRUE - -*Feature: ColorMode { - *rcNameID: =COLOR_PRINTING_MODE_DISPLAY - *DefaultOption: 24bpp - *ConcealFromUI?: TRUE - *Option: 24bpp { - *rcNameID: =24BPP_DISPLAY - *DevNumOfPlanes: 1 - *DevBPP: 24 - *DrvBPP: 24 - } -} - -*Feature: Memory { - *rcNameID: =PRINTER_MEMORY_DISPLAY - *DefaultOption: 65536KB - *Option: 16384KB { - *Name: "16MB" - *MemoryConfigKB: PAIR(16384, 16384) - } - *Option: 65536KB { - *Name: "64MB" - *MemoryConfigKB: PAIR(65536, 65536) - } -} - -*Feature: Orientation { - *rcNameID: =ORIENTATION_DISPLAY - *DefaultOption: PORTRAIT - *Option: PORTRAIT { - *rcNameID: =PORTRAIT_DISPLAY - } - *Option: LANDSCAPE_CC270 { - *rcNameID: =LANDSCAPE_DISPLAY - } -} - -*Feature: PaperSize { - *rcNameID: =PAPER_SIZE_DISPLAY - *DefaultOption: LETTER - - *Option: A2 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(19842, 28062) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(28062, 19842) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A3 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(14031, 19842) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(19842, 14031) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(9921, 14031) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(14031, 9921) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A5 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(6992, 9921) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(9921, 6992) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A6 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4960, 6992) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(6992, 4960) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A4_PLUS { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(9921, 15590) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(15590, 9921) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A3_EXTRA { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(15212, 21023) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(21023, 15212) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A4_EXTRA { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(11102, 15212) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(15212, 11102) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: A5_EXTRA { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(8220, 11102) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(11102, 8220) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: B4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(12141, 17196) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(17196, 12141) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: B5 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(8598, 12141) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(12141, 8598) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_B4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(11811, 16677) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(16677, 11811) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_B5 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(8314, 11811) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(11811, 8314) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_B6 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5905, 8314) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(8314, 5905) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: B6_JIS { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(6047, 8598) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(8598, 6047) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: B5_EXTRA { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(9496, 13039) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(13039, 9496) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_C3 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(15307, 21637) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(21637, 15307) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_C4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10818, 15307) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(15307, 10818) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_C5 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(7653, 10818) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10818, 7653) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_C6 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5385, 7653) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(7653, 5385) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_C65 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5385, 10818) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10818, 5385) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_DL { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5196, 10393) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10393, 5196) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: JENV_CHOU3 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5669, 11102) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(11102, 5669) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: JENV_CHOU4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4251, 9685) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(9685, 4251) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: JAPANESE_POSTCARD { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4724, 6992) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(6992, 4724) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: JENV_KAKU2 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(11338, 15685) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(15685, 11338) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: DBL_JAPANESE_POSTCARD { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(6992, 9448) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(9448, 6992) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: JENV_YOU4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4960, 11102) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(11102, 4960) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: 10X11 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(12000, 13200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(13200, 12000) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: 10X14 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(12000, 16800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(16800, 12000) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: 9X11 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10800, 13200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(13200, 10800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: CSHEET { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(20400, 26400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(26400, 20400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: DSHEET { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(26400, 40800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(40800, 26400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ESHEET { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(40800, 52800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(52800, 40800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: EXECUTIVE { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(8700, 12600) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(12600, 8700) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: FANFOLD_STD_GERMAN { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10200, 14400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(14400, 10200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: FANFOLD_US { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(13200, 17850) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(17850, 13200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: FOLIO { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10200, 15600) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(15600, 10200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: STATEMENT { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(6600, 10200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10200, 6600) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: TABLOID { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(13200, 20400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(20400, 13200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: LEGAL { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10200, 16800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(16800, 10200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: LEGAL_EXTRA { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(11400, 18000) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(18000, 11400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: LETTER { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10200, 13200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(13200, 10200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: LETTER_EXTRA { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(11400, 14400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(14400, 11400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: LETTER_PLUS { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10200, 15228) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(15228, 10200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_MONARCH { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4650, 9000) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(9000, 4650) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_9 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4650, 10650) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10650, 4650) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_10 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4950, 11400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(11400, 4950) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_11 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5400, 12450) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(12450, 5400) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_12 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5700, 13200) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(13200, 5700) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_14 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(6000, 13800) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(13800, 6000) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: ENV_INVITE { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(10393, 10393) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10393, 10393) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_1 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(4818, 7795) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(7795, 4818) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_3 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5905, 8314) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(8314, 5905) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_4 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5196, 9826) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(9826, 5196) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_5 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5196, 10393) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10393, 5196) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_6 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5669, 10866) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10866, 5669) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_7 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(7559, 10866) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(10866, 7559) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_8 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(5669, 14598) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(14598, 5669) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } - - *Option: PENV_10 { - *rcNameID: =RCID_DMPAPER_SYSTEM_NAME - *switch: Orientation { - *case: PORTRAIT { - *PrintableArea: PAIR(15307, 21637) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - *case: LANDSCAPE_CC270 { - *PrintableArea: PAIR(21637, 15307) - *PrintableOrigin: PAIR(0, 0) - *CursorOrigin: PAIR(0, 0) - } - } - } -} - -*Feature: Resolution { - *rcNameID: =RESOLUTION_DISPLAY - *DefaultOption: 600dpi - - *Option: 600dpi { - *Name: "600 x 600 " =DOTS_PER_INCH - *DPI: PAIR(600, 600) - *TextDPI: PAIR(600, 600) - *SpotDiameter: 100 - *Command: CmdBeginRaster { *Cmd: "<1B>*v7S<1B>*r1A" } - *Command: CmdEndRaster { *Cmd: "<1B>*rC" } - *Command: CmdSendBlockData { *Cmd: "<1B>*b" %d {NumOfDataBytes}"W" } - } -} - -*Command: CmdCR { *Cmd: "<0D>" } -*Command: CmdLF { *Cmd: "<0A>" } -*Command: CmdFF { *Cmd: "<0C>" } diff --git a/cloud_print/virtual_driver/win/install/inf/gcp_driver.inf b/cloud_print/virtual_driver/win/install/inf/gcp_driver.inf deleted file mode 100644 index ad57e0a81858f061414a5bac34cb712fa1bee9f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13086 zcmeHNPiP!f82{2tR%UkGL$Odq+G(_;hGskaC&@wL+1QCTUEYKT9`B zYi*B$R}YoaYaxdoVgy0-V2x-)4*^BQiwFfT_EONh`upDOWZtC7PIkL9AykH)nfKsmX%;kGz;$ecn#({w zN;4RBwD?}8bQBcKf$na+VOr2Ui8*;1!TWfvMe)`s`gk<2n3ei1KBj>-PA7mnhI3q8 zTj)4=)eI`4Xh%U2)5mwFcniPj+_p$9iR^@uG&nyeC}8x*g>C7qDx2xQTR z_Aqo|2+v2*H-!5UXl-9{e5ti=d|=+wiecNx$StV8M+Efz9PKTBCK~D-fOz(*Vw0DfaS|x?F{;+#Jd)S zr=*N`xz@^2 z+T8CR@A!|M%F(faXG?ypr<@DOT9`wdscHL5%rVE z0-6zFnsDtxZwhxAM4g0qo`D8*iAzf&?O0r8ymP$!|NN^&_uN_0v#WhrGqN5|gmsacOoAK9(!4F|5R^6yQq= zh;pp+ytdnO#Du@KRx~i)sZtEY={dZ`p^JUy@v>HO>xsW>ZMNy^uV&{dwq#4mgR3}4 zqB%(3va`tzz3{3lIS$ITkRf8h802Tg4p~;Vbf28VH8tzQIC3JluaqN@8y{D1N&I3( z4fYFZYp5Y~EYucyHDpj%s4>)wb|%zOY`38|8aff`675!uY$%S+gxK)aan+cyW z_Q8MUVMXl23L=jjg-&zU;+DJ2X>ZhibC&l^*aJTVa*h!O_J9m{Ra+MpHlg=MZ0CHz z=z^oQ%zJ0I%o}H`&-&ojSqEqNelF!R(wntk*M497L+!V<4{%+s{jRoBjpd!qHlNW} zhp&t@<1>9&M19)#fI1O;4EjPRD+#^Vn*h>nMr_0)! zc1uI{rLAg9+Pb!)-O;?{ZlZGY7vt}BKiBbQSI$T1_3#*B}K7TdAjkWT; zEAD%JSuLde4SDx@>Lq#p79J$Z&&)r~CG&x4(68nr^KbK>>4h*Ea4cQc*YsODJgL5_ zFX`+0ihfh~!pPs=gXH4;kJrCkx&PZ21}VR+d}aRRg)i=VG&*F+cJq>9z!&A=jTUen z7Zuz=1Wy=+)B!QyYgXPTUl89@FN?EV;&Kh+ z&DCK2lp}pPv*!QWl}4IECg3+xdGAHujpeu?Ta?USnTpaBBte1SyK*)K9L?AhuxF?i zcE9)N_A4pnl+vMeDyH(fa#~3%Zz*kxLG9>Gq1B-@BJG^+7|lZjGLv4h%VOd{?6+)wp71&Nw>GgUg(LbyrHz?+@qA%4@TexX z%hM0`9=j8zWe?}=r<2fQzdePUr_15B@J$@+_}vNL3mf!N_%>R%!>i%DxZVxl4}TN> z98XGX10xSsZ=-sTeh{@>qu#HZdb_?)Ka6Yt4(hpJ_d`xal*r4G)<|!pDe_$8P$U^S zg7azgnUNQ9D3PO)c%&in0{Xmo9K%1^_J$tEeXpALBcjEWCQ2$Nm5hjd?TB-!r;d8@ zfc3cYoR0sK5u`SJGVu6X?tDJ?+GJ@x<*#PJBKzyp$Jg??_dg!FSQ;6Bz1dx4{{h{X BFf{-G diff --git a/cloud_print/virtual_driver/win/install/resources/cloudprint.ico b/cloud_print/virtual_driver/win/install/resources/cloudprint.ico deleted file mode 100644 index e362c727d987e8974c21eb734de42a4100bd5811..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73070 zcmeHQZH!#ic^(HUqbe;(O;vuRS}LUxsj5Qz15ickrI;!$HIAyPKN5qWm0GAFrb#85 z(qyfg;1&XIVz9xEV%1J!3L(Y>0;omnPmHn6diHyFcD}!MXJ%)-Y`_Ksr|)~teeXT@ z%>6ib=FSc~dslk*+%xy%oO_<?u(DG zi-zMzolg%OJ~K3Mcx2=Ysq)+-sq!p~Pbb*qe}1K@?H8d9@cw@Z z_AXfb+w0i#ue`?I7#?Lu?byAW?bx-OJ-KTad*bO`Z2MDBv+wVG zihXa#PWE3s`ECUaPaEQ=>oFFD~~s@MOd zIA3RY4XQ_4z7L}gBdOFKPUolQ=6Af@+`l@V zOP>|%^#@Az#>ZwI=BmkbrE(?h_e%@ah0ho3=XT_)^Cz>F+V*^9;dlMcVJsHQ^nqOt zw%TqW94HskEqaA$9cW8UmQ(O6Mv;&s!guPeWWBHYV zo7jtY{ULky_G{R4WE=iqASfS$luvC>{simrbEpHA|9qR}H(~G6_EbLlw5n8xcFPAp z($XK+;U#E?=kI8*{W0z!lj9F74%y4&5Q;}WfS3dg{dx`R@cQ5XQCs-ywm-Hz#S>UI z+IwKGWk#<}QfW7{+U8NwAVsKDED7-&gyd zQ~Muz{64n*2R~$oPM=|KjEu75@ey|9YW!(#k6mB$!T z#IhKRVl0XA=x{QPF)7Bi?Cq%pJ3TqgPK{6UHZWr3+p+vit@edXrFs-&OKuP!%5|YO zL2NL7=KN@?LxIP!7*CI9pnQm_M^b4XSD#Hl9j0g4nJFlLVhZc<{+pu{|AJ-XUxKmK zxk~LWj7=dvfo?I*ezb4U9U7Hb}9zr)LI-rV;}u$0qNAvB__XlCA&H zRW2!1=a2C^U_Fd@U9AVU1>#|~1N7CR7z<20;6QB0>d`)?KJ z8v}gIBe#WA2aban!x(&&`-5l$&I6+_j3iQj<6o+EM6rS8H<(%nxqk>Q7&uUWfH9$+ z2fQ!5b2^!X(TV;ajQJjf@fMVC)q(m4)&X&V@hwXmZGgI<@?ZkSm3(ZP&YFEqw+6t0 zzrylG9e|G#4$f^L{FbFjgh6&Ua0*9if&Pj`_N!2KjhD~cLDZqS4Y)SeKocLHDbJ>$ zFMd2-D7`yXD83Hk+AjwxR5=(p@V8!VU}8|N+@+ivTDDX_hdlTQ#_xiQHDe4f`oc$< z*~){V73OlGd~M-+7`s0UZC^tk0RA`cWEQU7VWrtu&VYA&Xf&6Otd=1z@2J8aZhn6we2E#J2M}Td? zk{QE!ip^j!Nny=X#6E?eM1N5WL@f}tK-2x74NoBmNNwfCDP_OWyZ8sQt(ZAN*H52fB`b8`|&I=jG2e@L$m! zQ1O?2yVrIoe!s(gU$g&{My$w~u&elYxbFwVe?{s*gg=i1Nds0K2W0%c^j_VktN*U^ zJxied`2BoM|F0gmVthd>`0HZdtudb!|Fw+&iqU~y#vgy1&|?3m^LkzfI*EU`wLb*> zdtL_!f7QRc<(G^0BlaQT-_soEP5cG+A>!Y&99T~HTXCK9cRj5A9l^gRInXKmU48!& z%=wV^WBS(DZs5O7$KR(r8U1ElC;cg0LwS6@?6Zi!o3B?tUmm{S>ifh4HxB4vPRAhj z5&rt$^9;NHTiUL#{e-`p4iL6FX@tK%_PX;vy5H;d`;Ldq4Hm&^9FVc~+a~N+vi>hu->>42`BM-R`e82b?`8be7|$)=P5fnj_u6*C+UYZV zPmV4JWbAvf|GVL>ejYad;ro7n?I$kKyP|YB5aDmVM^%RdpJd;!;;*9v5&pf6zZVBo z?D4(5%YMQ~xdBz@-SRqpACC#U|9km+c^~y{zm&9JO`Uu}gnzKU-#z?;`+gOFCmo3J zxA4bz7xnTV@qu)}3Hz0*|Jbj4{g3b`9fIn5`@?vjqde!2+tk1PQolY= z`)z$6^*`$WTJc}l_^UX(<^6D{{e-Vy8sTrv`=Jle)&B_p?{ZIq^ z`aSKB`oDAk@AV0w2!A{7qzBahBm6&E<3CvcYP(oJQmhf^yj|w&OX3=nvff%VCM^s^V(aaiB{`0xmW^(TeFTAW9@ z#o3Xev*p3T!A}Q`9AK^X8~NIhxE`OE@%2Sje%QI-hC6+}qVZS8emE8+{2w#%M;=%l zApC!H;2>Z76xX-s93cGT!+bqf;sC76x+y6B(3gj3?N&-Xc|aU--~-|8mPYv7`~Txc z{}((U4S>|>|Cs(5u;=T}8f(uA4vg@1aD@(#1`M+!Z=X#E!GESuzLPN5Nj-T1d~m~^ zK9BHM@ZYhM$sADqz)xN{Xs-DyI55iBANKMCgQrj5sLO$5c@Fx%SclX(6>B}kzsQv+ZPY)?NBj}PeJpU9W{ z&2^b+eP%grffsJL)8~G;)Bcr)zsiCA2VXSS+8*cqzlj472Q>KsiUo&;|5pcp=DoEuUSppaO8#13BuVeC4BwT6@&jy(f_#)7_q?qgFolk<9hQa$1MEq93cE59#mq% zBSZ1BAO0{-xD+&f(GPd8{U#?QKDgmdpZnoX`&SPBPjUSxKky7-|JL{<7-COmaR7Zl zvma=V1^w_(lu`S|di2fd9IR8XZ~u4n7`yjto7lQ_>$KxP!r3kDN&Fq2|6O<8b?ndo z;#T&}fz9lh7hhthIQEFYodekS$t(^?8lcPx_~DOhf8!eTvhnrcaZPyHY#eFk1Y*B_ z{d$i5O2I$O`G3S8?WUVw02EMRHCm^BuVG{6sk(DxA?%)O35J`nDd zlAm`=-Sl4l{FAKzVfKH*p4v~~4;*mx1C|e;5M~8;<8u%}IVXM23>K&y* z|JrSb)4cx+4X`*saiD!XplSe(2am;vU-82~J6C0HmVteCv&RWCH}2ac;=Xq8J34TB!_V2@_g02mKA#ey^zR5bwRf=0Zsr+r#|-wAv5GldJXZ*bb?V+cNeXdX-2=aa1G z4)XH_>w5{-cMkY>4~mcnOB73%6-sQHTM<&j@RMlQ8y50h`6pI6$1Ral!HtE%CsdQ*_{g`P^B2_kg~8g7~+>0fE0W z2RQyJ2ORJpl{g^qM;_QYAn-RhAmeXv;LMch|3U+R15zxgqX7{Aji9!B;ZFNb5-|)j+ z-VbBH2Yj)2;)cQpZ7%5Wz$-3Lw4gaAXw4URalkhg@bUw48~}bm!~vL691xxcoERMs zyslKTSh=w!{8dg!e9+>84-YJ#VAldm2k^TpLJM>_pvHp> z@dFSCy2XNFY5bX({cIg{BAJ7U$tgVAV;)$VQ|4$4?H-4V+QeDx-&Z9 zJT6q@LCrCtgCFRm2Amw5eD1{1#8pn12Kg*KJ9|UE2H3lqjTd%KXmKGB51hvdLJRC1 z;Blc_JRpq?&2b_AK0#w{KsOc$>IeMBgRb)d(pccs01ID~i3mRa>g4Uc6#Q|p~rm8R>aN^A5 z)V5Qj6MsE8IvV(Q9Xeb{&&_=~5dJbJI2SZ|pc5Y~H3uLT6!D-M3;6qiurxpiqfQ?K z_@8K*1IPzO6Fl|6PYVKaz;j%{eL?fMP#qJfv4EZ*aEJw4(11>3t8;xL4!BqVEL984 z3rQ3Fc;FQu1{oWK&H)cU(8`}X6Hu&+N zEe_bn1u6&3`5~t1FkWl!hulz zfMYD!JTKU!0h(ihrNlKzS@}xkbHIU#qKviIb`Tzf%mJNv&>jnT_yLDlu#*}P1e2vc zcC=FYbg@?3j~pO#jSYw!3J<)sK+GLE`U5u|aG4))nkNq82R!ElI;a6ljcF_8<>#s! zKntqG0ZKi&pvwb83qs*Q=zhSO7Ys!M)9EXUe2!rLJmF8ND-Sx( z0sEMs6+hq=3)JQv>0Q`X4 z*w85+)b<0~a{|s9AkPQLbAs}70r~sFPV+$!|1Y+KMK{mI`J(J>Z7pF>sXGU7tRQ$0 z8VB5Bfk1x1dtR_v16-aB>5c^@9}u5OPjnN*Fv=#})zpy(l0R_gfJ;p184qgs0jFoh zej4C277!ZH`dAR=0S<(LK{u~aoNt(8gKlv^#}9bV3D`Bje=N|N1~mJC)Pvo`E{w8^ zb-*9Zg$FI^fLko!Hc#A+9|)=eA;y72i9~-G7tL_ z4wRn>DD#0M$@C(`P?vQRyD-WwQU8}yT`lm72i$bPB^Ge>13Iywh6aQc2a*qf?*!}% zqy4*m4aC2*9B_ySyQTqNV?i|z^qvbin@s*?x3LSOe8QhnKY!pH4|vQEbV389v4HDy z0f%RUZW<8S2c)tI96yKA{@uI=-UHz-r|odSaa?HpMx|+v*vSucDh`0Lpd0@9J967t z&|xk>o(meDN#EH`+`=l`4S(c9U=Dc20&Qx5-+_^8w)hCwigp6Nlt} zuWomZ15O&C9S2I!hC}rM;(5SuGP#!8t`}0kxS`@M=j|M@o+Hy-QByqNHAn398#E^$ z0Pmwv#{!{@1zYd|_U8eaoxOm$d=D`1GbH2fwC%-#X8b*#69n-CIvU^+2g=U{O&<_s zK3ItX!2b`8cIY=eG9F944cP8?!d(5#KA1MIGmZ_*{V9 z2blQdyM?$01d9Ox`*J*y`0P?+vlQi(8Vj3BjdOesK*e0noA_gFsBoYe|9~3cG9TdV z1FUz=IO30M+ZY^h(*U<|fYUe--W^pQPN%P43M{%&MxoNUmg66o1NK;;nFB5w&=DUH zU>u+s1K@W8#Rgax z|5ts0+w-7o_Lb99Q=g$W>gBXlKeyGy-$w`Rejr2*2;>8FVgU35#&coE-wL_K0QtsL zF1N9l@mB8*zbjrw++{PK3&=45ZJQiWG{DyXQ4b6aaGMisbv`gPTe+AlmF@@spRnE~ z(Yg=d&jWLX^Wgutji%FAs_nB9@__vT8wYgo=dqxN288AVEdA&2m4USn5EGn-OO;9+ zVC~bRP4AS_jREt8#B{#+z)HoPxQ%fj;D0fE4G0hiI?V+sF#!1gi!-^|-=}(0nkW=L zJ5wm#4L*M#*br!c!_>T`zA$>*gJB!ZHZGn8X(Qoqu zI&pw+9N4}OK;2KmI@h}Q5gpfh3zX{%8+GCUa~z-<2Wt5Mmlz;BTm6UD?M!@ysCH!-|hIv>S) zK@jTvvHbVr_4-c0+@=L4{=PAwTmQ%RPYMmlR%;i*7wnA2c%8?y)e_+MkfU2k?ji56sLq&+D~X&*;3)wg5geD%I;-VZJBdD*oB(d_GsJZJo(iKG)gWMpy4- z3!o;H8jVfxev$p~j({O}4%krV0pb0mjRL-_yjt6zpP%0p_4Q675?woLfv5$d7KmCP zYJsQ)dZ7ha2!Em-`shj@iu~o2zaa9fDSuAnFQI%!BscKOhP)^J|oRpOQB!U>v-Yd`HPGHnLPX6E;BIL@&sqo>dTb&lZr9px$f>!% zPn<6r6kedSM$Z3wjO3m12JSmV?!m|#2SaiQ0ics1pTYb9Y#4tWVahl1s#|BS6T2Ar2KhbPz$mro76{r@SG8$JL4 diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ar.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ar.xtb deleted file mode 100644 index 8a494d5740769b..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ar.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -برنامج تشغيل XPS غير مثبّت. -طابعة متوافقة مع خدمة طباعة في السحاب من Google - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bg.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bg.xtb deleted file mode 100644 index cfc0956d126453..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bg.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Драйверът XPS не е инсталиран. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bn.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bn.xtb deleted file mode 100644 index 67e55574a96af0..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_bn.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ড্রাইভার ইনস্টল করা নেই৷ -Google মেঘ মুদ্রণ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ca.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ca.xtb deleted file mode 100644 index 7709263bcf1e94..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ca.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -El controlador XPS no està instal·lat. -Impressora de Google Cloud - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_cs.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_cs.xtb deleted file mode 100644 index 3ea6cb49d6e89c..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_cs.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Není nainstalován ovladač XPS. -Tiskárna v cloudu Google - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_da.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_da.xtb deleted file mode 100644 index c0f9c34fa83b44..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_da.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS-driver er ikke installeret. -Google Cloudprinter - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_de.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_de.xtb deleted file mode 100644 index 09daae639e2e34..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_de.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS-Treiber ist nicht installiert. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_el.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_el.xtb deleted file mode 100644 index 428c5e6a8ac987..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_el.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Το πρόγραμμα οδήγησης XPS δεν είναι εγκατεστημένο. -Εκτυπωτής Google Cloud - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_en-GB.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_en-GB.xtb deleted file mode 100644 index fa23175762d933..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_en-GB.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS driver is not installed. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es-419.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es-419.xtb deleted file mode 100644 index e8685de3d74dff..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es-419.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -El controlador XPS no está instalado. -Impresora de Google Cloud - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es.xtb deleted file mode 100644 index a021491b1fb68b..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_es.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -El controlador XPS no está instalado. -Impresora en la nube de Google - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_et.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_et.xtb deleted file mode 100644 index 67319bf61579f9..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_et.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS-draiver on installimata. -Google'i pilvprinter - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fa.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fa.xtb deleted file mode 100644 index 8cee1341b98341..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fa.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -راه‌انداز XPS‏ نصب نشده است. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fi.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fi.xtb deleted file mode 100644 index c56f62f4125ce4..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fi.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS-ajuria ei ole asennettu. -Google Cloud -tulostin - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fil.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fil.xtb deleted file mode 100644 index 56a8cf9d8fdc57..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fil.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Hindi naka-install ang XPS driver. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fr.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fr.xtb deleted file mode 100644 index f928f8174196d9..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_fr.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Le pilote XPS n'est pas installé. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_gu.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_gu.xtb deleted file mode 100644 index 1446cb8eebef47..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_gu.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ડ્રાઇવર ઇન્સ્ટોલ કરેલું નથી. -Google મેઘ મુદ્રણ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_he.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_he.xtb deleted file mode 100644 index 49c7b8bae05b95..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_he.xtb +++ /dev/null @@ -1,4 +0,0 @@ - - מנהל ההתקן של XPS לא מותקן. -מדפסת Google Cloud Print - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hi.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hi.xtb deleted file mode 100644 index ecf98ae4aeda2b..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hi.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ड्राइवर इंस्टॉल नहीं है. -Google क्लाउड प्रिंटर - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hr.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hr.xtb deleted file mode 100644 index 763791b4539791..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hr.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Upravljački program za XPS nije instaliran. -Google pisač u oblaku - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hu.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hu.xtb deleted file mode 100644 index a871cf492e59d9..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_hu.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Nincs telepítve XPS illesztőprogram. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_id.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_id.xtb deleted file mode 100644 index dbdc14e6c89920..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_id.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Driver XPS tidak terpasang. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_it.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_it.xtb deleted file mode 100644 index 7d6b3fa2de3f83..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_it.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Il driver XPS non è installato. -Google Cloud Print - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ja.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ja.xtb deleted file mode 100644 index e2a1155aa4121b..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ja.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ドライバがインストールされていません。 -Google クラウド プリンタ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_kn.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_kn.xtb deleted file mode 100644 index af30a4d0bfa764..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_kn.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ಡ್ರೈವರ್ ಅನ್ನು ಸ್ಥಾಪಿಸಲಾಗಿಲ್ಲ. -Google ಮೇಘ ಮುದ್ರಕ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ko.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ko.xtb deleted file mode 100644 index 9a3686e824e786..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ko.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS 드라이버가 설치되지 않았습니다. -Google 클라우드 프린터 - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lt.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lt.xtb deleted file mode 100644 index fa4099735539fc..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lt.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS tvarkyklė neįdiegta. -„Google“ spausdinimo iš debesies programa - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lv.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lv.xtb deleted file mode 100644 index 61d82259551020..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_lv.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS dzinis nav instalēts. -Google mākoņprinteris - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ml.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ml.xtb deleted file mode 100644 index b57290cce8f926..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ml.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ഡ്രൈവർ ഇൻസ്റ്റാളുചെയ്‌തിട്ടില്ല. -Google ക്ലൗഡ് പ്രിന്റർ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_mr.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_mr.xtb deleted file mode 100644 index a93c0e4320ab26..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_mr.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS ड्राइव्हर स्थापित केलेला नाही. -Google मेघ प्रिंटर - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ms.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ms.xtb deleted file mode 100644 index 810d7403454a36..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ms.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Pemacu XPS tidak dipasang. -Pencetak Awan Google - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_nl.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_nl.xtb deleted file mode 100644 index 48389cae6d7be5..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_nl.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS-stuurprogramma is niet geïnstalleerd. -Google Cloudprinter - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_no.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_no.xtb deleted file mode 100644 index 27974594308363..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_no.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS-driveren er ikke installert. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pl.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pl.xtb deleted file mode 100644 index a84a993e5bc680..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pl.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Sterownik XPS nie jest zainstalowany. -Drukarka Google Cloud - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-BR.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-BR.xtb deleted file mode 100644 index e9a4f359a03a89..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-BR.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -O driver XPS não está instalado. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-PT.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-PT.xtb deleted file mode 100644 index ffeafd961f89b1..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_pt-PT.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -O controlador XPS não está instalado. -Impressora do Google Cloud Print - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ro.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ro.xtb deleted file mode 100644 index 2677e95212e485..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ro.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Driverul XPS nu este instalat. -Imprimanta Google Cloud Print - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ru.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ru.xtb deleted file mode 100644 index 2e5ae1a88258bc..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ru.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Драйвер XPS не установлен. -Виртуальный принтер Google - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sk.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sk.xtb deleted file mode 100644 index fbb21354b9a332..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sk.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Ovládač XPS nie je nainštalovaný. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sl.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sl.xtb deleted file mode 100644 index 0d2d286ec661b1..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sl.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Gonilnik XPS ni nameščen. -Tiskalnik za Google Tiskanje v oblaku - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sr.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sr.xtb deleted file mode 100644 index ad5c7240f1571e..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sr.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Управљачки програм за XPS није инсталиран. -Google Cloud штампач - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sv.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sv.xtb deleted file mode 100644 index de6b6010cb11a5..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sv.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Ingen XPS-drivrutin är installerad. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sw.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sw.xtb deleted file mode 100644 index fca4065ee0b55f..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_sw.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS driver is not installed. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ta.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ta.xtb deleted file mode 100644 index e0d2f3f3e9bbd1..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_ta.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS இயக்கி நிறுவப்படவில்லை. -Google மேகக்கணி அச்சுப்பொறி - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_te.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_te.xtb deleted file mode 100644 index 6f22db1e10313c..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_te.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS డ్రైవర్ ఇన్‌స్టాల్ చేయబడలేదు. -Google మేఘ ప్రింటర్ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_th.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_th.xtb deleted file mode 100644 index 82622972c47a6e..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_th.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -ไม่ได้ติดตั้งไดรเวอร์ XPS -Google เครื่องพิมพ์ระบบคลาวด์ - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_tr.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_tr.xtb deleted file mode 100644 index 06f6187d680f57..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_tr.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -XPS sürücüsü yüklü değil. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_uk.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_uk.xtb deleted file mode 100644 index aa33a6f02aad64..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_uk.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Драйвер XPS не встановлено. -Веб-доступний принтер Google - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_vi.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_vi.xtb deleted file mode 100644 index 72ed68156de8b7..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_vi.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -Trình điều khiển XPS chưa được cài đặt. -Google Cloud Printer - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-CN.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-CN.xtb deleted file mode 100644 index 259b52b5aac739..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-CN.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -未安装 XPS 驱动程序 -Google 云端打印机 - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-HK.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-HK.xtb deleted file mode 100644 index 820244f931eebf..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-HK.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -未安裝 XPS 驅動程式 -Google 雲端印表機 - diff --git a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-TW.xtb b/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-TW.xtb deleted file mode 100644 index 00dad44fb8b399..00000000000000 --- a/cloud_print/virtual_driver/win/install/resources/virtual_driver_setup_resources_zh-TW.xtb +++ /dev/null @@ -1,4 +0,0 @@ - -未安裝 XPS 驅動程式 -Google 雲端印表機 - diff --git a/cloud_print/virtual_driver/win/install/setup.cc b/cloud_print/virtual_driver/win/install/setup.cc deleted file mode 100644 index 5f56f3044b9103..00000000000000 --- a/cloud_print/virtual_driver/win/install/setup.cc +++ /dev/null @@ -1,434 +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. - -#include -#include // Must be included after windows.h -#include -#include - -#include -#include - -#include "base/at_exit.h" -#include "base/command_line.h" -#include "base/files/file_util.h" -#include "base/logging.h" -#include "base/path_service.h" -#include "base/process/launch.h" -#include "base/process/process.h" -#include "base/strings/string_util.h" -#include "base/win/windows_version.h" -#include "cloud_print/common/win/cloud_print_utils.h" -#include "cloud_print/common/win/install_utils.h" -#include "cloud_print/virtual_driver/win/install/grit/virtual_driver_setup_resources.h" -#include "cloud_print/virtual_driver/win/virtual_driver_consts.h" -#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h" - -#include // Must be after base headers to avoid deprecation - // warnings. - -namespace cloud_print { - -namespace { - -const wchar_t kNameValue[] = L"GCP Virtual Driver"; -const wchar_t kUninstallId[] = L"{74AA24E0-AC50-4B28-BA46-9CF05467C9B7}"; -const wchar_t kGcpUrl[] = L"https://www.google.com/cloudprint"; - -const wchar_t kInfFileName[] = L"gcp_driver.inf"; - -const char kDelete[] = "delete"; -const char kInstallSwitch[] = "install"; -const char kRegisterSwitch[] = "register"; -const char kUninstallSwitch[] = "uninstall"; -const char kUnregisterSwitch[] = "unregister"; - -base::FilePath GetSystemPath(const std::wstring& binary) { - base::FilePath path; - if (!base::PathService::Get(base::DIR_SYSTEM, &path)) { - LOG(ERROR) << "Unable to get system path."; - return path; - } - return path.Append(binary); -} - -base::FilePath GetNativeSystemPath(const std::wstring& binary) { - if (!IsSystem64Bit()) - return GetSystemPath(binary); - base::FilePath path; - // Sysnative will bypass filesystem redirection and give us - // the location of the 64bit system32 from a 32 bit process. - if (!base::PathService::Get(base::DIR_WINDOWS, &path)) { - LOG(ERROR) << "Unable to get windows path."; - return path; - } - return path.Append(L"sysnative").Append(binary); -} - -void SpoolerServiceCommand(const char* command) { - base::FilePath net_path = GetNativeSystemPath(L"net"); - if (net_path.empty()) - return; - base::CommandLine command_line(net_path); - command_line.AppendArg(command); - command_line.AppendArg("spooler"); - command_line.AppendArg("/y"); - - base::LaunchOptions options; - options.wait = true; - options.start_hidden = true; - VLOG(0) << command_line.GetCommandLineString(); - base::LaunchProcess(command_line, options); -} - -HRESULT RegisterPortMonitor(bool install, const base::FilePath& install_path) { - DCHECK(install || install_path.empty()); - base::FilePath target_path = GetNativeSystemPath(GetPortMonitorDllName()); - if (target_path.empty()) { - LOG(ERROR) << "Unable to get port monitor target path."; - return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); - } - if (install) { - base::FilePath source_path = install_path.Append(GetPortMonitorDllName()); - if (!base::CopyFile(source_path, target_path)) { - LOG(ERROR) << "Unable copy port monitor dll from " << source_path.value() - << " to " << target_path.value(); - return GetLastHResult(); - } - } else if (!base::PathExists(target_path)) { - // Already removed. Just "succeed" silently. - return S_OK; - } - - base::FilePath regsvr32_path = GetNativeSystemPath(L"regsvr32.exe"); - if (regsvr32_path.empty()) { - LOG(ERROR) << "Can't find regsvr32.exe."; - return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); - } - - base::CommandLine command_line(regsvr32_path); - command_line.AppendArg("/s"); - if (!install) { - command_line.AppendArg("/u"); - } - - // Use system32 path here because otherwise ::AddMonitor would fail. - command_line.AppendArgPath(GetSystemPath(GetPortMonitorDllName())); - - base::LaunchOptions options; - options.wait = true; - - base::Process regsvr32_process = - base::LaunchProcess(command_line.GetCommandLineString(), options); - if (!regsvr32_process.IsValid()) { - LOG(ERROR) << "Unable to launch regsvr32.exe."; - return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); - } - - DWORD exit_code = S_OK; - if (install) { - if (!GetExitCodeProcess(regsvr32_process.Handle(), &exit_code)) { - LOG(ERROR) << "Unable to get regsvr32.exe exit code."; - return GetLastHResult(); - } - if (exit_code != 0) { - LOG(ERROR) << "Regsvr32.exe failed with " << exit_code; - return HRESULT_FROM_WIN32(exit_code); - } - } else { - if (!base::DeleteFile(target_path)) { - SpoolerServiceCommand("stop"); - bool deleted = base::DeleteFile(target_path); - SpoolerServiceCommand("start"); - - if (!deleted) { - LOG(ERROR) << "Unable to delete " << target_path.value(); - return HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED); - } - } - } - return S_OK; -} - -HRESULT InstallDriver(const base::FilePath& install_path) { - DWORD size = MAX_PATH * 10; - wchar_t package_path[MAX_PATH * 10] = {0}; - - base::FilePath inf_file = install_path.Append(kInfFileName); - std::wstring driver_name = LoadLocalString(IDS_DRIVER_NAME); - - HRESULT result = UploadPrinterDriverPackage( - NULL, inf_file.value().c_str(), NULL, - UPDP_SILENT_UPLOAD | UPDP_UPLOAD_ALWAYS, NULL, package_path, &size); - if (FAILED(result)) { - LOG(WARNING) - << "Uploading the printer driver package to the driver cache silently " - << "failed. Will retry with user UI. HRESULT=0x" << std::setbase(16) - << result; - - result = UploadPrinterDriverPackage( - NULL, inf_file.value().c_str(), NULL, UPDP_UPLOAD_ALWAYS, - GetForegroundWindow(), package_path, &size); - - if (FAILED(result)) { - LOG(WARNING) - << "Uploading the printer driver package to the driver cache failed" - << "with user UI. Aborting."; - return result; - } - } - - result = InstallPrinterDriverFromPackage( - NULL, package_path, driver_name.c_str(), NULL, IPDFP_COPY_ALL_FILES); - if (FAILED(result)) { - LOG(ERROR) << "Installing the printer driver failed."; - } - return result; -} - -HRESULT UninstallDriver(const base::FilePath& install_path) { - base::FilePath inf_file = install_path.Append(kInfFileName); - int tries = 3; - - while (!DeletePrinterDriverPackage(NULL, inf_file.value().c_str(), NULL)) { - if (GetLastError() == ERROR_UNKNOWN_PRINTER_DRIVER) { - LOG(WARNING) << "Print driver is already uninstalled."; - return S_OK; - } - // After deleting the printer it can take a few seconds before - // the driver is free for deletion. Retry a few times before giving up. - LOG(WARNING) << "Attempt to delete printer driver failed. Retrying."; - tries--; - Sleep(2000); - } - if (tries <= 0) { - HRESULT result = GetLastHResult(); - LOG(ERROR) << "Unable to delete printer driver."; - return result; - } - return S_OK; -} - -HRESULT InstallPrinter(void) { - PRINTER_INFO_2 printer_info = {0}; - - // None of the print API structures likes constant strings even though they - // don't modify the string. const_casting is the cleanest option. - std::wstring driver_name = LoadLocalString(IDS_DRIVER_NAME); - printer_info.pDriverName = const_cast(driver_name.c_str()); - printer_info.pPrinterName = const_cast(driver_name.c_str()); - printer_info.pComment = const_cast(driver_name.c_str()); - printer_info.pLocation = const_cast(kGcpUrl); - std::u16string port_name; - printer_info.pPortName = const_cast(kPortName); - printer_info.Attributes = PRINTER_ATTRIBUTE_DIRECT | PRINTER_ATTRIBUTE_LOCAL; - printer_info.pPrintProcessor = const_cast(L"winprint"); - HANDLE handle = AddPrinter(NULL, 2, reinterpret_cast(&printer_info)); - if (handle == NULL) { - HRESULT result = GetLastHResult(); - LOG(ERROR) << "Unable to add printer"; - return result; - } - ClosePrinter(handle); - return S_OK; -} - -HRESULT UninstallPrinter(void) { - HANDLE handle = NULL; - PRINTER_DEFAULTS printer_defaults = {0}; - printer_defaults.DesiredAccess = PRINTER_ALL_ACCESS; - std::wstring driver_name = LoadLocalString(IDS_DRIVER_NAME); - if (!OpenPrinter(const_cast(driver_name.c_str()), &handle, - &printer_defaults)) { - // If we can't open the printer, it was probably already removed. - LOG(WARNING) << "Unable to open printer"; - return S_OK; - } - if (!DeletePrinter(handle)) { - HRESULT result = GetLastHResult(); - LOG(ERROR) << "Unable to delete printer"; - ClosePrinter(handle); - return result; - } - ClosePrinter(handle); - return S_OK; -} - -bool IsOSSupported() { - // We don't support Vista or older. - return base::win::GetVersion() >= base::win::Version::WIN7; -} - -HRESULT RegisterVirtualDriver(const base::FilePath& install_path) { - HRESULT result = S_OK; - - DCHECK(base::DirectoryExists(install_path)); - if (!IsOSSupported()) { - LOG(ERROR) << "Requires Windows 7 or later."; - return HRESULT_FROM_WIN32(ERROR_OLD_WIN_VERSION); - } - - result = InstallDriver(install_path); - if (FAILED(result)) { - LOG(ERROR) << "Unable to install driver."; - return result; - } - - result = RegisterPortMonitor(true, install_path); - if (FAILED(result)) { - LOG(ERROR) << "Unable to register port monitor."; - return result; - } - - result = InstallPrinter(); - if (FAILED(result) && - result != HRESULT_FROM_WIN32(ERROR_PRINTER_ALREADY_EXISTS)) { - LOG(ERROR) << "Unable to install printer."; - return result; - } - return S_OK; -} - -HRESULT TryUnregisterVirtualDriver(const base::FilePath& install_path) { - HRESULT result = S_OK; - result = UninstallPrinter(); - if (FAILED(result)) { - LOG(ERROR) << "Unable to delete printer."; - return result; - } - result = UninstallDriver(install_path); - if (FAILED(result)) { - LOG(ERROR) << "Unable to remove driver."; - return result; - } - // The second argument is ignored if the first is false. - result = RegisterPortMonitor(false, base::FilePath()); - if (FAILED(result)) { - LOG(ERROR) << "Unable to remove port monitor."; - return result; - } - return S_OK; -} - -HRESULT UnregisterVirtualDriver(const base::FilePath& install_path) { - HRESULT hr = S_FALSE; - for (int i = 0; i < 2; ++i) { - hr = TryUnregisterVirtualDriver(install_path); - if (SUCCEEDED(hr)) { - break; - } - // Restart spooler and try again. - SpoolerServiceCommand("stop"); - SpoolerServiceCommand("start"); - } - return hr; -} - -HRESULT DoUninstall(const base::FilePath& install_path) { - DeleteGoogleUpdateKeys(kGoogleUpdateProductId); - HRESULT result = UnregisterVirtualDriver(install_path); - if (FAILED(result)) - return result; - DeleteUninstallKey(kUninstallId); - DeleteProgramDir(kDelete); - return S_OK; -} - -HRESULT DoUnregister(const base::FilePath& install_path) { - return UnregisterVirtualDriver(install_path); -} - -HRESULT DoRegister(const base::FilePath& install_path) { - HRESULT result = UnregisterVirtualDriver(install_path); - if (FAILED(result)) - return result; - return RegisterVirtualDriver(install_path); -} - -HRESULT DoDelete(const base::FilePath& install_path) { - if (install_path.value().empty()) - return E_INVALIDARG; - if (!base::DirectoryExists(install_path)) - return S_FALSE; - Sleep(5000); // Give parent some time to exit. - return base::DeletePathRecursively(install_path) ? S_OK : E_FAIL; -} - -HRESULT DoInstall(const base::FilePath& install_path) { - HRESULT result = UnregisterVirtualDriver(install_path); - if (FAILED(result)) { - LOG(ERROR) << "Unable to unregister."; - return result; - } - base::FilePath old_install_path = GetInstallLocation(kUninstallId); - if (!old_install_path.value().empty() && install_path != old_install_path) { - if (base::DirectoryExists(old_install_path)) - base::DeletePathRecursively(old_install_path); - } - CreateUninstallKey(kUninstallId, LoadLocalString(IDS_DRIVER_NAME), - kUninstallSwitch); - result = RegisterVirtualDriver(install_path); - if (FAILED(result)) - return result; - SetGoogleUpdateKeys(kGoogleUpdateProductId, kNameValue); - return result; -} - -HRESULT ExecuteCommands() { - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - - base::FilePath exe_path; - if (!base::PathService::Get(base::DIR_EXE, &exe_path) || - !base::DirectoryExists(exe_path)) { - return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); - } - - if (command_line.HasSwitch(kDelete)) { - return DoDelete(command_line.GetSwitchValuePath(kDelete)); - } else if (command_line.HasSwitch(kUninstallSwitch)) { - return DoUninstall(exe_path); - } else if (command_line.HasSwitch(kInstallSwitch)) { - return DoInstall(exe_path); - } else if (command_line.HasSwitch(kUnregisterSwitch)) { - return DoUnregister(exe_path); - } else if (command_line.HasSwitch(kRegisterSwitch)) { - return DoRegister(exe_path); - } - - return E_INVALIDARG; -} - -} // namespace - -} // namespace cloud_print - -int WINAPI WinMain(__in HINSTANCE hInstance, - __in HINSTANCE hPrevInstance, - __in LPSTR lpCmdLine, - __in int nCmdShow) { - base::AtExitManager at_exit_manager; - base::CommandLine::Init(0, nullptr); - - HRESULT retval = cloud_print::ExecuteCommands(); - - if (retval == HRESULT_FROM_WIN32(ERROR_BAD_DRIVER)) { - cloud_print::SetGoogleUpdateError( - cloud_print::kGoogleUpdateProductId, - cloud_print::LoadLocalString(IDS_ERROR_NO_XPS)); - } else if (FAILED(retval)) { - cloud_print::SetGoogleUpdateError(cloud_print::kGoogleUpdateProductId, - retval); - } - - VLOG(0) << cloud_print::GetErrorMessage(retval) << " HRESULT=0x" - << std::setbase(16) << retval; - - // Installer is silent by default as required by Google Update. - if (base::CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { - cloud_print::DisplayWindowsMessage( - nullptr, retval, cloud_print::LoadLocalString(IDS_DRIVER_NAME)); - } - return retval; -} diff --git a/cloud_print/virtual_driver/win/install/virtual_driver_setup_exe.ver b/cloud_print/virtual_driver/win/install/virtual_driver_setup_exe.ver deleted file mode 100644 index 1667c07f059aa5..00000000000000 --- a/cloud_print/virtual_driver/win/install/virtual_driver_setup_exe.ver +++ /dev/null @@ -1,3 +0,0 @@ -INTERNAL_NAME=virtual_driver_setup.exe -ORIGINAL_FILENAME=virtual_driver_setup.exe -FILETYPE=0x1L diff --git a/cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd b/cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd deleted file mode 100644 index 1113da1580739b..00000000000000 --- a/cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Google Cloud Printer - - - <a href="https://www.microsoft.com/download/details.aspx?id=11816"><a href="https://www.microsoft.com/download/details.aspx?id=11816">XPS driver</a></a> is not installed. - - - - - - - - - diff --git a/cloud_print/virtual_driver/win/port_monitor/BUILD.gn b/cloud_print/virtual_driver/win/port_monitor/BUILD.gn deleted file mode 100644 index cf9bdb92c465a7..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/BUILD.gn +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2015 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("//build/config/compiler/compiler.gni") -import("//chrome/process_version_rc_template.gni") - -assert(is_win) - -group("port_monitor") { - public_deps = [ ":port_monitor_dll" ] -} - -shared_library("port_monitor_dll") { - output_name = "gcp_portmon" - if (current_cpu == "x64") { - output_name = "gcp_portmon64" - } - - sources = [ - "port_monitor.def", - "port_monitor_dll.cc", - ] - - deps = [ - ":lib", - ":resources", - "//base", - "//chrome/common:constants", - "//chrome/common:version_header", - "//cloud_print/common", - "//cloud_print/virtual_driver/win", - ] - - libs = [ "userenv.lib" ] -} - -group("copy_gcp_portmon_binaries") { - deps = [ ":copy_gcp_portmon_dll" ] - # TODO(pastarmovj): Find some way to reference the pdb file for the 64bit dll - # simply using it in the sources directive causes gn to error when generating - # the build files. -} - -if (current_cpu == "x64") { - copy("copy_gcp_portmon_dll") { - sources = [ "$root_out_dir/gcp_portmon64.dll" ] - outputs = [ "$root_out_dir/gcp_portmon.dll" ] - deps = [ ":port_monitor_dll" ] - } -} else { - # Make sure that we have a copy of gcp_portmon64.dll in the root out - # directory. - if (is_clang) { - gcp_portmon64_toolchain = "//build/toolchain/win:win_clang_x64" - } else { - gcp_portmon64_toolchain = "//build/toolchain/win:x64" - } - gcp_portmon64_label = ":port_monitor_dll($gcp_portmon64_toolchain)" - - gcp_portmon64_out_dir = get_label_info(gcp_portmon64_label, "root_out_dir") - - if (symbol_level > 0) { - copy("copy_gcp_portmon_pdb") { - visibility = [ ":copy_gcp_portmon_dll" ] - sources = [ "$gcp_portmon64_out_dir/gcp_portmon64.dll.pdb" ] - outputs = [ "$root_out_dir/{{source_file_part}}" ] - deps = [ gcp_portmon64_label ] - } - } - copy("copy_gcp_portmon_dll") { - sources = [ "$gcp_portmon64_out_dir/gcp_portmon64.dll" ] - outputs = [ "$root_out_dir/{{source_file_part}}" ] - deps = [ gcp_portmon64_label ] - if (symbol_level > 0) { - deps += [ ":copy_gcp_portmon_pdb" ] - } - } -} - -source_set("lib") { - sources = [ - "port_monitor.cc", - "port_monitor.h", - ] - - deps = [ - "//base", - "//chrome/common:constants", - "//chrome/installer/launcher_support", - "//cloud_print/common", - "//cloud_print/virtual_driver/win", - ] -} - -process_version_rc_template("resources") { - sources = [ "../gcp_portmon_dll.ver" ] - - # Note: target_gen_dir will be different for each toolchain so the output - # name doesn't need mangling. - output = "$target_gen_dir/gcp_portmon_dll.rc" -} diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc deleted file mode 100644 index a25a6d75b63e53..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc +++ /dev/null @@ -1,683 +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. - -#include "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "base/at_exit.h" -#include "base/command_line.h" -#include "base/files/file_enumerator.h" -#include "base/files/file_util.h" -#include "base/logging.h" -#include "base/memory/raw_ptr.h" -#include "base/path_service.h" -#include "base/process/launch.h" -#include "base/process/process.h" -#include "base/strings/string_util.h" -#include "base/win/registry.h" -#include "base/win/scoped_handle.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/installer/launcher_support/chrome_launcher_support.h" -#include "cloud_print/common/win/cloud_print_utils.h" -#include "cloud_print/virtual_driver/win/port_monitor/spooler_win.h" -#include "cloud_print/virtual_driver/win/virtual_driver_consts.h" -#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h" - -namespace cloud_print { - -namespace { - -const wchar_t kIePath[] = L"Internet Explorer\\iexplore.exe"; - -const char kChromeInstallUrl[] = - "https://google.com/cloudprint/learn/chrome.html"; - -const wchar_t kCloudPrintRegKey[] = L"Software\\Google\\CloudPrint"; - -const wchar_t kXpsMimeType[] = L"application/vnd.ms-xpsdocument"; - -const wchar_t kAppDataDir[] = L"Google\\Cloud Printer"; - -const wchar_t kDocumentPathPlaceHolder[] = L"%%Document_Path%%"; - -const wchar_t kDocumentTypePlaceHolder[] = L"%%Document_Type%%"; - -const wchar_t kJobTitlePlaceHolder[] = L"%%Job_Title%%"; - -struct MonitorData { - std::unique_ptr at_exit_manager; -}; - -struct PortData { - PortData() : job_id(0), printer_handle(NULL), file(nullptr) {} - ~PortData() { Close(); } - void Close() { - if (printer_handle) { - ClosePrinter(printer_handle); - printer_handle = NULL; - } - if (file) { - base::CloseFile(file); - file = nullptr; - } - } - DWORD job_id; - HANDLE printer_handle; - raw_ptr file; - base::FilePath file_path; -}; - -typedef struct { ACCESS_MASK granted_access; } XcvUiData; - -MONITORUI g_monitor_ui = {sizeof(MONITORUI), MonitorUiAddPortUi, - MonitorUiConfigureOrDeletePortUI, - MonitorUiConfigureOrDeletePortUI}; - -MONITOR2 g_monitor_2 = {sizeof(MONITOR2), - Monitor2EnumPorts, - Monitor2OpenPort, - nullptr, // OpenPortEx is not supported. - Monitor2StartDocPort, - Monitor2WritePort, - Monitor2ReadPort, - Monitor2EndDocPort, - Monitor2ClosePort, - nullptr, // AddPort is not supported. - nullptr, // AddPortEx is not supported. - nullptr, // ConfigurePort is not supported. - nullptr, // DeletePort is not supported. - nullptr, - nullptr, // SetPortTimeOuts is not supported. - Monitor2XcvOpenPort, - Monitor2XcvDataPort, - Monitor2XcvClosePort, - Monitor2Shutdown}; - -base::FilePath GetLocalAppDataLow() { - wchar_t system_buffer[MAX_PATH]; - if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, - system_buffer))) - return base::FilePath(); - return base::FilePath(system_buffer).DirName().AppendASCII("LocalLow"); -} - -base::FilePath GetAppDataDir() { - base::FilePath file_path = GetLocalAppDataLow(); - if (file_path.empty()) { - LOG(ERROR) << "Can't get app data dir"; - } - return file_path.Append(kAppDataDir); -} - -// Delete files which where not deleted by chrome. -void DeleteLeakedFiles(const base::FilePath& dir) { - base::Time delete_before = base::Time::Now() - base::Days(1); - base::FileEnumerator enumerator(dir, false, base::FileEnumerator::FILES); - for (base::FilePath file_path = enumerator.Next(); !file_path.empty(); - file_path = enumerator.Next()) { - if (enumerator.GetInfo().GetLastModifiedTime() < delete_before) - base::DeleteFile(file_path); - } -} - -// Attempts to retrieve the title of the specified print job. -// On success returns TRUE and the first title_chars characters of the job title -// are copied into title. -// On failure returns FALSE and title is unmodified. -bool GetJobTitle(HANDLE printer_handle, DWORD job_id, std::wstring* title) { - DCHECK(printer_handle != NULL); - DCHECK(title != NULL); - DWORD bytes_needed = 0; - GetJob(printer_handle, job_id, 1, NULL, 0, &bytes_needed); - if (bytes_needed == 0) { - LOG(ERROR) << "Unable to get bytes needed for job info."; - return false; - } - std::unique_ptr buffer(new BYTE[bytes_needed]); - if (!GetJob(printer_handle, job_id, 1, buffer.get(), bytes_needed, - &bytes_needed)) { - LOG(ERROR) << "Unable to get job info."; - return false; - } - JOB_INFO_1* job_info = reinterpret_cast(buffer.get()); - *title = job_info->pDocument; - return true; -} - -// Handler for the UI functions exported by the port monitor. -// Verifies that a valid parent Window exists and then just displays an -// error message to let the user know that there is no interactive -// configuration. -void HandlePortUi(HWND hwnd, const std::wstring& caption) { - if (hwnd != NULL && IsWindow(hwnd)) { - DisplayWindowsMessage(hwnd, CO_E_NOT_SUPPORTED, cloud_print::kPortName); - } -} - -// Gets the primary token for the user that submitted the print job. -bool GetUserToken(HANDLE* primary_token) { - HANDLE token = NULL; - if (!OpenThreadToken(GetCurrentThread(), - TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY, - FALSE, &token)) { - LOG(ERROR) << "Unable to get thread token."; - return false; - } - base::win::ScopedHandle token_scoped(token); - if (!DuplicateTokenEx( - token, TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY, NULL, - SecurityImpersonation, TokenPrimary, primary_token)) { - LOG(ERROR) << "Unable to get primary thread token."; - return false; - } - return true; -} - -bool LaunchCommandAsUser(const base::CommandLine& command) { - HANDLE token = NULL; - if (!GetUserToken(&token)) { - LOG(ERROR) << "Unable to get user token."; - return false; - } - base::win::ScopedHandle primary_token_scoped(token); - base::LaunchOptions options; - options.as_user = primary_token_scoped.Get(); - base::LaunchProcess(command, options); - return true; -} - -// Escape the command line argument as necessary per Microsoft rules. -// See QuoteForCommandLineToArgvW in base/command_line.cc -std::wstring EscapeCommandLineArg(const std::wstring& arg) { - std::wstring quotable_chars(L" \\\""); - if (arg.find_first_of(quotable_chars) == std::wstring::npos) { - // No quoting necessary. - return arg; - } - - std::wstring out; - out.push_back(L'"'); - for (size_t i = 0; i < arg.size(); ++i) { - if (arg[i] == '\\') { - // Find the extent of this run of backslashes. - size_t start = i, end = start + 1; - for (; end < arg.size() && arg[end] == '\\'; ++end) { - } - size_t backslash_count = end - start; - - // Backslashes are escapes only if the run is followed by a double quote. - // Since we also will end the string with a double quote, we escape for - // either a double quote or the end of the string. - if (end == arg.size() || arg[end] == '"') { - // To quote, we need to output 2x as many backslashes. - backslash_count *= 2; - } - for (size_t j = 0; j < backslash_count; ++j) - out.push_back('\\'); - - // Advance i to one before the end to balance i++ in loop. - i = end - 1; - } else if (arg[i] == '"') { - out.push_back('\\'); - out.push_back('"'); - } else { - out.push_back(arg[i]); - } - } - out.push_back('"'); - - return out; -} - -// Launch the print command as specified in the cloud print registry. -bool LaunchPrintCommandFromTemplate(const std::wstring& command_template, - const base::FilePath& xps_path, - const std::wstring& job_title) { - std::wstring command_string(command_template); - // Substitude the place holder with the document path wrapped in quotes. - base::ReplaceFirstSubstringAfterOffset( - &command_string, 0, kDocumentPathPlaceHolder, - EscapeCommandLineArg(xps_path.value())); - // Substitude the place holder with the document type wrapped in quotes. - base::ReplaceFirstSubstringAfterOffset( - &command_string, 0, kDocumentTypePlaceHolder, kXpsMimeType); - // Substitude the place holder with the job title wrapped in quotes. - base::ReplaceFirstSubstringAfterOffset(&command_string, 0, - kJobTitlePlaceHolder, - EscapeCommandLineArg(job_title)); - - base::CommandLine command = base::CommandLine::FromString(command_string); - - return LaunchCommandAsUser(command); -} - -// Launches a page to allow the user to download chrome. -// TODO(abodenha@chromium.org) Point to a custom page explaining what's wrong -// rather than the generic chrome download page. See -// http://code.google.com/p/chromium/issues/detail?id=112019 -void LaunchChromeDownloadPage() { - if (kIsUnittest) - return; - HANDLE token = NULL; - if (!GetUserToken(&token)) { - LOG(ERROR) << "Unable to get user token."; - return; - } - base::win::ScopedHandle token_scoped(token); - - // Consider using the shell to invoke the default browser instead of hardcoded - // reference to IE which might not be available on the system. - base::FilePath ie_path; - base::PathService::Get(base::DIR_PROGRAM_FILESX86, &ie_path); - ie_path = ie_path.Append(kIePath); - base::CommandLine command_line(ie_path); - command_line.AppendArg(kChromeInstallUrl); - - base::LaunchOptions options; - options.as_user = token_scoped.Get(); - base::LaunchProcess(command_line, options); -} - -// Returns false if the print job is being run in a context -// that shouldn't be launching Chrome. -bool ValidateCurrentUser() { - HANDLE token = NULL; - if (!GetUserToken(&token)) { - // If we can't get the token we're probably not impersonating - // the user, so validation should fail. - return false; - } - base::win::ScopedHandle token_scoped(token); - - DWORD session_id = 0; - DWORD dummy = 0; - if (!::GetTokenInformation(token_scoped.Get(), TokenSessionId, - reinterpret_cast(&session_id), - sizeof(DWORD), &dummy)) { - return false; - } - - return session_id != 0; -} -} // namespace - -std::wstring ReadStringFromRegistry(HKEY root, const wchar_t* path_name) { - base::win::RegKey gcp_key(root, kCloudPrintRegKey, KEY_READ); - std::wstring data; - gcp_key.ReadValue(path_name, &data); - return data; -} - -std::wstring ReadStringFromAnyRegistry(const wchar_t* path_name) { - std::wstring result = ReadStringFromRegistry(HKEY_CURRENT_USER, path_name); - if (!result.empty()) - return result; - return ReadStringFromRegistry(HKEY_LOCAL_MACHINE, path_name); -} - -base::FilePath GetChromeExePath() { - std::wstring value = ReadStringFromAnyRegistry(kChromeExePathRegValue); - if (!value.empty() && base::PathExists(base::FilePath(value))) - return base::FilePath(value); - return chrome_launcher_support::GetAnyChromePath(false /* is_sxs */); -} - -base::FilePath GetChromeProfilePath() { - std::wstring value = ReadStringFromAnyRegistry(kChromeProfilePathRegValue); - if (!value.empty() && base::DirectoryExists(base::FilePath(value))) - return base::FilePath(value); - return base::FilePath(); -} - -// Launches the Cloud Print dialog in Chrome. -bool LaunchChromePrintDialog(const base::FilePath& xps_path, - const std::wstring& job_title) { - base::FilePath chrome_path = GetChromeExePath(); - if (chrome_path.empty()) { - LOG(ERROR) << "Unable to get chrome exe path."; - LaunchChromeDownloadPage(); - return false; - } - - base::CommandLine command_line(chrome_path); - - base::FilePath chrome_profile = GetChromeProfilePath(); - if (!chrome_profile.empty()) - command_line.AppendSwitchPath(switches::kUserDataDir, chrome_profile); - - command_line.AppendSwitchPath(switches::kCloudPrintFile, xps_path); - command_line.AppendSwitchNative(switches::kCloudPrintFileType, kXpsMimeType); - command_line.AppendSwitchNative(switches::kCloudPrintJobTitle, job_title); - - return LaunchCommandAsUser(command_line); -} - -std::wstring GetPrintCommandTemplate() { - return ReadStringFromAnyRegistry(kPrintCommandRegValue); -} - -// Launches the print command. This will either launch Chrome to display the -// Cloud Print dialog or another exe as specified in the cloud print registry. -// xps_path references a file to print. -// job_title is the title to be used for the resulting print job. -bool LaunchPrintCommand(const base::FilePath& xps_path, - const std::wstring& job_title) { - std::wstring command_template = GetPrintCommandTemplate(); - if (!command_template.empty()) { - return LaunchPrintCommandFromTemplate(command_template, xps_path, - job_title); - } else { - return LaunchChromePrintDialog(xps_path, job_title); - } -} - -BOOL WINAPI Monitor2EnumPorts(HANDLE, - wchar_t*, - DWORD level, - BYTE* ports, - DWORD ports_size, - DWORD* needed_bytes, - DWORD* returned) { - if (needed_bytes == NULL) { - LOG(ERROR) << "needed_bytes should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if (level == 1) { - *needed_bytes = sizeof(PORT_INFO_1); - } else if (level == 2) { - *needed_bytes = sizeof(PORT_INFO_2); - } else { - LOG(ERROR) << "Level " << level << "is not supported."; - SetLastError(ERROR_INVALID_LEVEL); - return FALSE; - } - *needed_bytes += static_cast(cloud_print::kPortNameSize); - if (ports_size < *needed_bytes) { - LOG(WARNING) << *needed_bytes << " bytes are required. Only " << ports_size - << " were allocated."; - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - if (ports == NULL) { - LOG(ERROR) << "ports should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if (returned == NULL) { - LOG(ERROR) << "returned should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - // Windows expects any strings refernced by PORT_INFO_X structures to - // appear at the END of the buffer referenced by ports. Placing - // strings immediately after the PORT_INFO_X structure will cause - // EnumPorts to fail until the spooler is restarted. - // This is NOT mentioned in the documentation. - wchar_t* string_target = reinterpret_cast( - ports + ports_size - cloud_print::kPortNameSize); - if (level == 1) { - PORT_INFO_1* port_info = reinterpret_cast(ports); - port_info->pName = string_target; - StringCbCopy(port_info->pName, cloud_print::kPortNameSize, - cloud_print::kPortName); - } else { - PORT_INFO_2* port_info = reinterpret_cast(ports); - port_info->pPortName = string_target; - StringCbCopy(port_info->pPortName, cloud_print::kPortNameSize, - cloud_print::kPortName); - port_info->pMonitorName = NULL; - port_info->pDescription = NULL; - port_info->fPortType = PORT_TYPE_WRITE; - port_info->Reserved = 0; - } - *returned = 1; - return TRUE; -} - -BOOL WINAPI Monitor2OpenPort(HANDLE, wchar_t*, HANDLE* handle) { - if (handle == NULL) { - LOG(ERROR) << "handle should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - *handle = new PortData(); - return TRUE; -} - -BOOL WINAPI Monitor2StartDocPort(HANDLE port_handle, - wchar_t* printer_name, - DWORD job_id, - DWORD, - BYTE*) { - SetGoogleUpdateUsage(kGoogleUpdateProductId); - if (port_handle == NULL) { - LOG(ERROR) << "port_handle should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if (printer_name == NULL) { - LOG(ERROR) << "printer_name should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if (!ValidateCurrentUser()) { - // TODO(abodenha@chromium.org) Abort the print job. - return FALSE; - } - PortData* port_data = reinterpret_cast(port_handle); - port_data->job_id = job_id; - if (!OpenPrinter(printer_name, &(port_data->printer_handle), NULL)) { - LOG(WARNING) << "Unable to open printer " << printer_name << "."; - // We can continue without a handle to the printer. - // It just means we can't get the job title or tell the spooler that - // the print job is complete. - // This is the normal flow during a unit test. - port_data->printer_handle = NULL; - } - base::FilePath& file_path = port_data->file_path; - base::FilePath app_data_dir = GetAppDataDir(); - if (app_data_dir.empty()) - return FALSE; - DeleteLeakedFiles(app_data_dir); - if (!base::CreateDirectory(app_data_dir) || - !base::CreateTemporaryFileInDir(app_data_dir, &file_path)) { - LOG(ERROR) << "Can't create temporary file in " << app_data_dir.value(); - return FALSE; - } - port_data->file = base::OpenFile(file_path, "wb+"); - if (port_data->file == nullptr) { - LOG(ERROR) << "Error opening file " << file_path.value() << "."; - return FALSE; - } - return TRUE; -} - -BOOL WINAPI Monitor2WritePort(HANDLE port_handle, - BYTE* buffer, - DWORD buffer_size, - DWORD* bytes_written) { - PortData* port_data = reinterpret_cast(port_handle); - if (!ValidateCurrentUser()) { - // TODO(abodenha@chromium.org) Abort the print job. - return FALSE; - } - *bytes_written = - static_cast(fwrite(buffer, 1, buffer_size, port_data->file)); - if (*bytes_written > 0) { - return TRUE; - } else { - return FALSE; - } -} - -BOOL WINAPI Monitor2ReadPort(HANDLE, BYTE*, DWORD, DWORD* read_bytes) { - LOG(ERROR) << "Read is not supported."; - *read_bytes = 0; - SetLastError(ERROR_NOT_SUPPORTED); - return FALSE; -} - -BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle) { - if (!ValidateCurrentUser()) { - // TODO(abodenha@chromium.org) Abort the print job. - return FALSE; - } - PortData* port_data = reinterpret_cast(port_handle); - if (port_data == NULL) { - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - if (port_data->file != nullptr) { - base::CloseFile(port_data->file); - port_data->file = nullptr; - bool delete_file = true; - int64_t file_size = 0; - base::GetFileSize(port_data->file_path, &file_size); - if (file_size > 0) { - std::wstring job_title; - if (port_data->printer_handle != NULL) { - GetJobTitle(port_data->printer_handle, port_data->job_id, &job_title); - } - if (LaunchPrintCommand(port_data->file_path, job_title)) { - delete_file = false; - } - } - if (delete_file) - base::DeleteFile(port_data->file_path); - } - if (port_data->printer_handle != NULL) { - // Tell the spooler that the job is complete. - SetJob(port_data->printer_handle, port_data->job_id, 0, NULL, - JOB_CONTROL_SENT_TO_PRINTER); - } - port_data->Close(); - // Return success even if we can't display the dialog. - // TODO(abodenha@chromium.org) Come up with a better way of handling - // this situation. - return TRUE; -} - -BOOL WINAPI Monitor2ClosePort(HANDLE port_handle) { - if (port_handle == NULL) { - LOG(ERROR) << "port_handle should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - delete reinterpret_cast(port_handle); - return TRUE; -} - -VOID WINAPI Monitor2Shutdown(HANDLE monitor_handle) { - if (monitor_handle != NULL) { - delete reinterpret_cast(monitor_handle); - } -} - -BOOL WINAPI Monitor2XcvOpenPort(HANDLE, - const wchar_t*, - ACCESS_MASK granted_access, - HANDLE* handle) { - if (handle == NULL) { - LOG(ERROR) << "handle should not be NULL."; - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - XcvUiData* xcv_data = new XcvUiData(); - xcv_data->granted_access = granted_access; - *handle = xcv_data; - return TRUE; -} - -DWORD WINAPI Monitor2XcvDataPort(HANDLE xcv_handle, - const wchar_t* data_name, - BYTE*, - DWORD, - BYTE* output_data, - DWORD output_data_bytes, - DWORD* output_data_bytes_needed) { - XcvUiData* xcv_data = reinterpret_cast(xcv_handle); - DWORD ret_val = ERROR_SUCCESS; - if ((xcv_data->granted_access & SERVER_ACCESS_ADMINISTER) == 0) { - return ERROR_ACCESS_DENIED; - } - if (output_data == NULL || output_data_bytes == 0) { - return ERROR_INVALID_PARAMETER; - } - // We don't handle AddPort or DeletePort since we don't support - // dynamic creation of ports. - if (lstrcmp(L"MonitorUI", data_name) == 0) { - DWORD dll_path_len = 0; - base::FilePath dll_path(cloud_print::GetPortMonitorDllName()); - dll_path_len = static_cast(dll_path.value().length()); - if (output_data_bytes_needed != NULL) { - *output_data_bytes_needed = dll_path_len; - } - if (output_data_bytes < dll_path_len) { - return ERROR_INSUFFICIENT_BUFFER; - } else { - ret_val = StringCbCopy(reinterpret_cast(output_data), - output_data_bytes, dll_path.value().c_str()); - } - } else { - return ERROR_INVALID_PARAMETER; - } - return ret_val; -} - -BOOL WINAPI Monitor2XcvClosePort(HANDLE handle) { - delete reinterpret_cast(handle); - return TRUE; -} - -BOOL WINAPI MonitorUiAddPortUi(const wchar_t*, - HWND hwnd, - const wchar_t* monitor_name, - wchar_t**) { - HandlePortUi(hwnd, monitor_name); - return TRUE; -} - -BOOL WINAPI MonitorUiConfigureOrDeletePortUI(const wchar_t*, - HWND hwnd, - const wchar_t* port_name) { - HandlePortUi(hwnd, port_name); - return TRUE; -} - -} // namespace cloud_print - -MONITOR2* WINAPI InitializePrintMonitor2(MONITORINIT*, HANDLE* handle) { - if (handle == NULL) { - SetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } - cloud_print::MonitorData* monitor_data = new cloud_print::MonitorData; - *handle = monitor_data; - if (!cloud_print::kIsUnittest) { - // Unit tests set up their own AtExitManager - monitor_data->at_exit_manager = std::make_unique(); - // Single spooler.exe handles verbose users. - base::PathService::DisableCache(); - } - return &cloud_print::g_monitor_2; -} - -MONITORUI* WINAPI InitializePrintMonitorUI(void) { - return &cloud_print::g_monitor_ui; -} diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.def b/cloud_print/virtual_driver/win/port_monitor/port_monitor.def deleted file mode 100644 index 3b2cd17de8e144..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.def +++ /dev/null @@ -1,9 +0,0 @@ -; Copyright (c) 2011 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. - -EXPORTS - InitializePrintMonitor2 - InitializePrintMonitorUI - DllRegisterServer PRIVATE - DllUnregisterServer PRIVATE diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.h b/cloud_print/virtual_driver/win/port_monitor/port_monitor.h deleted file mode 100644 index e5407694c65ee1..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.h +++ /dev/null @@ -1,93 +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 CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_PORT_MONITOR_H_ -#define CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_PORT_MONITOR_H_ - -#include -#include -#include "base/files/file_util.h" -#include "base/process/process.h" - -namespace cloud_print { - -// Returns path to be used for launching Chrome. -base::FilePath GetChromeExePath(); - -// Returns path to user profile to be used for launching Chrome. -base::FilePath GetChromeProfilePath(); - -// Returns the print command to launch, if set, instead of Chrome. -std::wstring GetPrintCommandTemplate(); - -// Implementations for the function pointers in the MONITOR2 structure -// returned by InitializePrintMonitor2. The prototypes and behaviors -// are as described in the MONITOR2 documentation from Microsoft. - -BOOL WINAPI Monitor2EnumPorts(HANDLE, - wchar_t*, - DWORD level, - BYTE* ports, - DWORD ports_size, - DWORD* needed_bytes, - DWORD* returned); - -BOOL WINAPI Monitor2OpenPort(HANDLE monitor_data, wchar_t*, HANDLE* handle); - -BOOL WINAPI Monitor2StartDocPort(HANDLE port_handle, - wchar_t* printer_name, - DWORD job_id, - DWORD, - BYTE*); - -BOOL WINAPI Monitor2WritePort(HANDLE port, - BYTE* buffer, - DWORD buffer_size, - DWORD* bytes_written); - -BOOL WINAPI Monitor2ReadPort(HANDLE, BYTE*, DWORD, DWORD* bytes_read); - -BOOL WINAPI Monitor2EndDocPort(HANDLE port_handle); - -BOOL WINAPI Monitor2ClosePort(HANDLE port_handle); - -VOID WINAPI Monitor2Shutdown(HANDLE monitor_handle); - -BOOL WINAPI Monitor2XcvOpenPort(HANDLE monitor, - const wchar_t*, - ACCESS_MASK granted_access, - HANDLE* handle); - -DWORD WINAPI Monitor2XcvDataPort(HANDLE xcv_handle, - const wchar_t* data_name, - BYTE*, - DWORD, - BYTE* output_data, - DWORD output_data_bytes, - DWORD* output_data_bytes_needed); - -BOOL WINAPI Monitor2XcvClosePort(HANDLE handle); - -// Implementations for the function pointers in the MONITORUI structure -// returned by InitializePrintMonitorUI. The prototypes and behaviors -// are as described in the MONITORUI documentation from Microsoft. - -BOOL WINAPI MonitorUiAddPortUi(const wchar_t*, - HWND hwnd, - const wchar_t* monitor_name, - wchar_t**); - -BOOL WINAPI MonitorUiConfigureOrDeletePortUI(const wchar_t*, - HWND hwnd, - const wchar_t* port_name); - -extern const wchar_t kChromeExePath[]; -extern const wchar_t kChromeExePathRegValue[]; -extern const wchar_t kChromeProfilePathRegValue[]; -extern const wchar_t kPrintCommandRegValue[]; -extern const bool kIsUnittest; - -} // namespace cloud_print - -#endif // CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_PORT_MONITOR_H_ diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc deleted file mode 100644 index e32f673981260b..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_dll.cc +++ /dev/null @@ -1,87 +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. - -#include "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "base/at_exit.h" -#include "base/command_line.h" -#include "base/files/file_util.h" -#include "base/process/process_info.h" -#include "base/win/registry.h" -#include "base/win/scoped_handle.h" -#include "chrome/common/chrome_switches.h" -#include "cloud_print/common/win/cloud_print_utils.h" -#include "cloud_print/virtual_driver/win/port_monitor/spooler_win.h" -#include "cloud_print/virtual_driver/win/virtual_driver_consts.h" -#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h" - -namespace cloud_print { - -const wchar_t kChromeExePath[] = L"google\\chrome\\application\\chrome.exe"; -const wchar_t kChromeExePathRegValue[] = L"PathToChromeExe"; -const wchar_t kChromeProfilePathRegValue[] = L"PathToChromeProfile"; -const wchar_t kPrintCommandRegValue[] = L"PrintCommand"; -const bool kIsUnittest = false; - -namespace { - -// Returns true if Xps support is installed. -bool XpsIsInstalled() { - base::FilePath xps_path; - if (!SUCCEEDED(GetPrinterDriverDir(&xps_path))) - return false; - - xps_path = xps_path.Append(L"mxdwdrv.dll"); - return base::PathExists(xps_path); -} - -// Returns true if registration/unregistration can be attempted. -bool CanRegister() { - if (!XpsIsInstalled()) - return false; - return base::GetCurrentProcessIntegrityLevel() == base::HIGH_INTEGRITY; -} - -} // namespace - -} // namespace cloud_print - -HRESULT WINAPI DllRegisterServer(void) { - base::AtExitManager at_exit_manager; - if (!cloud_print::CanRegister()) { - return E_ACCESSDENIED; - } - MONITOR_INFO_2 monitor_info = {0}; - // YUCK!!! I can either copy the constant, const_cast, or define my own - // MONITOR_INFO_2 that will take const strings. - base::FilePath dll_path(cloud_print::GetPortMonitorDllName()); - monitor_info.pDLLName = const_cast(dll_path.value().c_str()); - monitor_info.pName = const_cast(dll_path.value().c_str()); - if (AddMonitor(NULL, 2, reinterpret_cast(&monitor_info))) { - return S_OK; - } - return cloud_print::GetLastHResult(); -} - -HRESULT WINAPI DllUnregisterServer(void) { - base::AtExitManager at_exit_manager; - if (!cloud_print::CanRegister()) { - return E_ACCESSDENIED; - } - base::FilePath dll_path(cloud_print::GetPortMonitorDllName()); - if (DeleteMonitor(NULL, NULL, const_cast(dll_path.value().c_str()))) { - return S_OK; - } - return cloud_print::GetLastHResult(); -} diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc deleted file mode 100644 index 0fe45b23461331..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/port_monitor_unittest.cc +++ /dev/null @@ -1,246 +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. - -#include "cloud_print/virtual_driver/win/port_monitor/port_monitor.h" - -#include -#include - -#include - -#include "base/files/file_util.h" -#include "base/path_service.h" -#include "base/win/registry.h" -#include "base/win/scoped_handle.h" -#include "cloud_print/virtual_driver/win/port_monitor/spooler_win.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace cloud_print { - -const wchar_t kChromeExePath[] = L"google\\chrome\\application\\chrometest.exe"; -const wchar_t kChromeExePathRegValue[] = L"PathToChromeTestExe"; -const wchar_t kChromeProfilePathRegValue[] = L"PathToChromeTestProfile"; -const wchar_t kPrintCommandRegValue[] = L"TestPrintCommand"; -const bool kIsUnittest = true; - -namespace { - -const wchar_t kAlternateChromeExePath[] = - L"google\\chrome\\application\\chrometestalternate.exe"; -const wchar_t kTestPrintCommand[] = L"testprintcommand.exe"; - -const wchar_t kCloudPrintRegKey[] = L"Software\\Google\\CloudPrint"; - -} // namespace - -class PortMonitorTest : public testing::Test { - public: - PortMonitorTest() = default; - PortMonitorTest(const PortMonitorTest&) = delete; - PortMonitorTest& operator=(const PortMonitorTest&) = delete; - - protected: - // Creates a registry entry pointing at a chrome - virtual void SetUpChromeExeRegistry() { - // Create a temporary chrome.exe location value. - base::win::RegKey key(HKEY_CURRENT_USER, cloud_print::kCloudPrintRegKey, - KEY_ALL_ACCESS); - - base::FilePath path; - base::PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - path = path.Append(kAlternateChromeExePath); - ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(cloud_print::kChromeExePathRegValue, - path.value().c_str())); - base::FilePath temp; - base::PathService::Get(base::DIR_TEMP, &temp); - // Write any dir here. - ASSERT_EQ(ERROR_SUCCESS, - key.WriteValue(cloud_print::kChromeProfilePathRegValue, - temp.value().c_str())); - - ASSERT_EQ(ERROR_SUCCESS, key.WriteValue(cloud_print::kPrintCommandRegValue, - kTestPrintCommand)); - } - // Deletes the registry entry created in SetUpChromeExeRegistry - virtual void DeleteChromeExeRegistry() { - base::win::RegKey key(HKEY_CURRENT_USER, cloud_print::kCloudPrintRegKey, - KEY_ALL_ACCESS); - key.DeleteValue(cloud_print::kChromeExePathRegValue); - key.DeleteValue(cloud_print::kChromeProfilePathRegValue); - key.DeleteValue(cloud_print::kPrintCommandRegValue); - } - - virtual void CreateTempChromeExeFiles() { - base::FilePath path; - base::PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - base::FilePath main_path = path.Append(kChromeExePath); - ASSERT_TRUE(base::CreateDirectory(main_path)); - base::FilePath alternate_path = path.Append(kAlternateChromeExePath); - ASSERT_TRUE(base::CreateDirectory(alternate_path)); - } - - virtual void DeleteTempChromeExeFiles() { - base::FilePath path; - base::PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - base::FilePath main_path = path.Append(kChromeExePath); - ASSERT_TRUE(base::DeletePathRecursively(main_path)); - base::PathService::Get(base::DIR_LOCAL_APP_DATA, &path); - base::FilePath alternate_path = path.Append(kAlternateChromeExePath); - ASSERT_TRUE(base::DeletePathRecursively(alternate_path)); - } - - void SetUp() override { SetUpChromeExeRegistry(); } - - void TearDown() override { DeleteChromeExeRegistry(); } -}; - -TEST_F(PortMonitorTest, GetChromeExePathTest) { - CreateTempChromeExeFiles(); - base::FilePath chrome_path = cloud_print::GetChromeExePath(); - EXPECT_FALSE(chrome_path.empty()); - EXPECT_TRUE(chrome_path.value().rfind(kAlternateChromeExePath) != - std::string::npos); - EXPECT_TRUE(base::PathExists(chrome_path)); - DeleteChromeExeRegistry(); - chrome_path = cloud_print::GetChromeExePath(); - // No Chrome or regular chrome path. - EXPECT_TRUE(chrome_path.empty() || - chrome_path.value().rfind(kChromeExePath) == std::string::npos); -} - -TEST_F(PortMonitorTest, GetPrintCommandTemplateTest) { - std::wstring print_command = cloud_print::GetPrintCommandTemplate(); - EXPECT_FALSE(print_command.empty()); - EXPECT_EQ(print_command, kTestPrintCommand); - DeleteChromeExeRegistry(); - print_command = cloud_print::GetPrintCommandTemplate(); - EXPECT_TRUE(print_command.empty()); -} - -TEST_F(PortMonitorTest, GetChromeProfilePathTest) { - base::FilePath data_path = cloud_print::GetChromeProfilePath(); - EXPECT_FALSE(data_path.empty()); - base::FilePath temp; - base::PathService::Get(base::DIR_TEMP, &temp); - EXPECT_EQ(data_path, temp); - EXPECT_TRUE(base::DirectoryExists(data_path)); - DeleteChromeExeRegistry(); - data_path = cloud_print::GetChromeProfilePath(); - EXPECT_TRUE(data_path.empty()); -} - -TEST_F(PortMonitorTest, EnumPortsTest) { - DWORD needed_bytes = 0; - DWORD returned = 0; - EXPECT_FALSE( - Monitor2EnumPorts(NULL, NULL, 1, NULL, 0, &needed_bytes, &returned)); - EXPECT_EQ(static_cast(ERROR_INSUFFICIENT_BUFFER), GetLastError()); - EXPECT_NE(0u, needed_bytes); - EXPECT_EQ(0u, returned); - - BYTE* buffer = new BYTE[needed_bytes]; - ASSERT_TRUE(buffer != NULL); - EXPECT_TRUE(Monitor2EnumPorts(NULL, NULL, 1, buffer, needed_bytes, - &needed_bytes, &returned)); - EXPECT_NE(0u, needed_bytes); - EXPECT_EQ(1u, returned); - PORT_INFO_1* port_info_1 = reinterpret_cast(buffer); - EXPECT_TRUE(port_info_1->pName != NULL); - delete[] buffer; - - returned = 0; - needed_bytes = 0; - EXPECT_FALSE( - Monitor2EnumPorts(NULL, NULL, 2, NULL, 0, &needed_bytes, &returned)); - EXPECT_EQ(static_cast(ERROR_INSUFFICIENT_BUFFER), GetLastError()); - EXPECT_NE(0u, needed_bytes); - EXPECT_EQ(0u, returned); - - buffer = new BYTE[needed_bytes]; - ASSERT_TRUE(buffer != NULL); - EXPECT_TRUE(Monitor2EnumPorts(NULL, NULL, 2, buffer, needed_bytes, - &needed_bytes, &returned)); - EXPECT_NE(0u, needed_bytes); - EXPECT_EQ(1u, returned); - PORT_INFO_2* port_info_2 = reinterpret_cast(buffer); - EXPECT_TRUE(port_info_2->pPortName != NULL); - delete[] buffer; -} - -TEST_F(PortMonitorTest, FlowTest) { - const wchar_t kXcvDataItem[] = L"MonitorUI"; - MONITORINIT monitor_init = {0}; - HANDLE monitor_handle = NULL; - HANDLE port_handle = NULL; - HANDLE xcv_handle = NULL; - DWORD bytes_processed = 0; - DWORD bytes_needed = 0; - const size_t kBufferSize = 100; - BYTE buffer[kBufferSize] = {0}; - - // Initialize the print monitor - MONITOR2* monitor2 = InitializePrintMonitor2(&monitor_init, &monitor_handle); - EXPECT_TRUE(monitor2 != NULL); - EXPECT_TRUE(monitor_handle != NULL); - - // Test the XCV functions. Used for reporting the location of the - // UI portion of the port monitor. - EXPECT_TRUE(monitor2->pfnXcvOpenPort != NULL); - EXPECT_TRUE(monitor2->pfnXcvOpenPort(monitor_handle, NULL, 0, &xcv_handle)); - EXPECT_TRUE(xcv_handle != NULL); - EXPECT_TRUE(monitor2->pfnXcvDataPort != NULL); - EXPECT_EQ(static_cast(ERROR_ACCESS_DENIED), - monitor2->pfnXcvDataPort(xcv_handle, kXcvDataItem, NULL, 0, buffer, - kBufferSize, &bytes_needed)); - EXPECT_TRUE(monitor2->pfnXcvClosePort != NULL); - EXPECT_TRUE(monitor2->pfnXcvClosePort(xcv_handle)); - EXPECT_TRUE(monitor2->pfnXcvOpenPort(monitor_handle, NULL, - SERVER_ACCESS_ADMINISTER, &xcv_handle)); - EXPECT_TRUE(xcv_handle != NULL); - EXPECT_TRUE(monitor2->pfnXcvDataPort != NULL); - EXPECT_EQ(static_cast(ERROR_SUCCESS), - monitor2->pfnXcvDataPort(xcv_handle, kXcvDataItem, NULL, 0, buffer, - kBufferSize, &bytes_needed)); - EXPECT_TRUE(monitor2->pfnXcvClosePort != NULL); - EXPECT_TRUE(monitor2->pfnXcvClosePort(xcv_handle)); - - // Test opening the port and running a print job. - EXPECT_TRUE(monitor2->pfnOpenPort != NULL); - EXPECT_TRUE(monitor2->pfnOpenPort(monitor_handle, NULL, &port_handle)); - EXPECT_TRUE(port_handle != NULL); - EXPECT_TRUE(monitor2->pfnStartDocPort != NULL); - EXPECT_TRUE(monitor2->pfnWritePort != NULL); - EXPECT_TRUE(monitor2->pfnReadPort != NULL); - EXPECT_TRUE(monitor2->pfnEndDocPort != NULL); - - // These functions should fail if we have not impersonated the user. - EXPECT_FALSE(monitor2->pfnStartDocPort(port_handle, const_cast(L""), - 0, 0, NULL)); - EXPECT_FALSE(monitor2->pfnWritePort(port_handle, buffer, kBufferSize, - &bytes_processed)); - EXPECT_EQ(0u, bytes_processed); - EXPECT_FALSE(monitor2->pfnReadPort(port_handle, buffer, sizeof(buffer), - &bytes_processed)); - EXPECT_EQ(0u, bytes_processed); - EXPECT_FALSE(monitor2->pfnEndDocPort(port_handle)); - - // Now impersonate so we can test the success case. - ASSERT_TRUE(ImpersonateSelf(SecurityImpersonation)); - EXPECT_TRUE(monitor2->pfnStartDocPort(port_handle, const_cast(L""), - 0, 0, NULL)); - EXPECT_TRUE(monitor2->pfnWritePort(port_handle, buffer, kBufferSize, - &bytes_processed)); - EXPECT_EQ(kBufferSize, bytes_processed); - EXPECT_FALSE(monitor2->pfnReadPort(port_handle, buffer, sizeof(buffer), - &bytes_processed)); - EXPECT_EQ(0u, bytes_processed); - EXPECT_TRUE(monitor2->pfnEndDocPort(port_handle)); - RevertToSelf(); - EXPECT_TRUE(monitor2->pfnClosePort != NULL); - EXPECT_TRUE(monitor2->pfnClosePort(port_handle)); - // Shutdown the port monitor. - Monitor2Shutdown(monitor_handle); -} - -} // namespace cloud_print diff --git a/cloud_print/virtual_driver/win/port_monitor/spooler_win.h b/cloud_print/virtual_driver/win/port_monitor/spooler_win.h deleted file mode 100644 index 0add066303b5b1..00000000000000 --- a/cloud_print/virtual_driver/win/port_monitor/spooler_win.h +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2011 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 CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_SPOOLER_WIN_H_ -#define CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_SPOOLER_WIN_H_ - -#include - -#include "base/memory/raw_ptr.h" - -// Compatible structures and prototypes are also defined in the Windows DDK in -// winsplp.h. -#ifndef _WINSPLP_ - -typedef struct { - DWORD size; - BOOL(WINAPI* pfnEnumPorts) - (HANDLE, - wchar_t*, - DWORD level, - BYTE* ports, - DWORD ports_size, - DWORD* needed_bytes, - DWORD* returned); - - BOOL(WINAPI* pfnOpenPort)(HANDLE monitor_data, wchar_t*, HANDLE* handle); - - void* pfnOpenPortEx; // Unused. - - BOOL(WINAPI* pfnStartDocPort) - (HANDLE port_handle, wchar_t* printer_name, DWORD job_id, DWORD, BYTE*); - - BOOL(WINAPI* pfnWritePort) - (HANDLE port, BYTE* buffer, DWORD buffer_size, DWORD* bytes_written); - - BOOL(WINAPI* pfnReadPort)(HANDLE, BYTE*, DWORD, DWORD* bytes_read); - - BOOL(WINAPI* pfnEndDocPort)(HANDLE port_handle); - - BOOL(WINAPI* pfnClosePort)(HANDLE port_handle); - - void* pfnAddPort; // Unused. - - void* pfnAddPortEx; // Unused. - - void* pfnConfigurePort; // Unused. - - void* pfnDeletePort; // Unused. - - void* pfnGetPrinterDataFromPort; // Unused. - - void* pfnSetPortTimeOuts; // Unusued. - - BOOL(WINAPI* pfnXcvOpenPort) - (HANDLE monitor, const wchar_t*, ACCESS_MASK granted_access, HANDLE* handle); - - DWORD(WINAPI* pfnXcvDataPort) - (HANDLE xcv_handle, - const wchar_t* data_name, - BYTE*, - DWORD, - BYTE* output_data, - DWORD output_data_bytes, - DWORD* output_data_bytes_needed); - - BOOL(WINAPI* pfnXcvClosePort)(HANDLE handle); - - VOID(WINAPI* pfnShutdown)(HANDLE monitor_handle); -} MONITOR2; - -typedef struct { - DWORD size; - - BOOL(WINAPI* pfnAddPortUI) - (const wchar_t*, HWND hwnd, const wchar_t* monitor_name, wchar_t**); - - BOOL(WINAPI* pfnConfigurePortUI) - (const wchar_t*, HWND hwnd, const wchar_t* port_name); - - BOOL(WINAPI* pfnDeletePortUI) - (const wchar_t*, HWND hwnd, const wchar_t* port_name); -} MONITORUI; - -typedef struct { - DWORD cbSize; - HANDLE hSpooler; - HKEY hckRegistryRoot; - raw_ptr pMonitorReg; // Unused - BOOL bLocal; - LPCWSTR pszServerName; -} MONITORINIT; - -MONITOR2* WINAPI InitializePrintMonitor2(MONITORINIT* monitor_init, - HANDLE* monitor_handle); - -MONITORUI* WINAPI InitializePrintMonitorUI(void); - -#endif // ifdef USE_WIN_DDK -#endif // CLOUD_PRINT_VIRTUAL_DRIVER_WIN_PORT_MONITOR_SPOOLER_WIN_H_ diff --git a/cloud_print/virtual_driver/win/virtual_driver_consts.cc b/cloud_print/virtual_driver/win/virtual_driver_consts.cc deleted file mode 100644 index ffa975f900f709..00000000000000 --- a/cloud_print/virtual_driver/win/virtual_driver_consts.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2011 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. - -#include "cloud_print/virtual_driver/win/virtual_driver_consts.h" - -#include -#include - -#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h" - -namespace cloud_print { - -const wchar_t kPortName[] = L"GCP:"; -const size_t kPortNameSize = sizeof(kPortName); -const wchar_t kGoogleUpdateProductId[] = - L"{9B13FA92-1F73-4761-AB78-2C6ADAC3660D}"; - -} // namespace cloud_print diff --git a/cloud_print/virtual_driver/win/virtual_driver_consts.h b/cloud_print/virtual_driver/win/virtual_driver_consts.h deleted file mode 100644 index f97022d128df4d..00000000000000 --- a/cloud_print/virtual_driver/win/virtual_driver_consts.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2011 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 CLOUD_PRINT_VIRTUAL_DRIVER_WIN_VIRTUAL_DRIVER_CONSTS_H_ -#define CLOUD_PRINT_VIRTUAL_DRIVER_WIN_VIRTUAL_DRIVER_CONSTS_H_ - -namespace cloud_print { - -extern const wchar_t kPortName[]; -extern const size_t kPortNameSize; -extern const wchar_t kGoogleUpdateProductId[]; - -} // namespace cloud_print - -#endif // CLOUD_PRINT_VIRTUAL_DRIVER_WIN_VIRTUAL_DRIVER_CONSTS_H_ diff --git a/cloud_print/virtual_driver/win/virtual_driver_helpers.cc b/cloud_print/virtual_driver/win/virtual_driver_helpers.cc deleted file mode 100644 index 709389d0377367..00000000000000 --- a/cloud_print/virtual_driver/win/virtual_driver_helpers.cc +++ /dev/null @@ -1,52 +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. - -#include "cloud_print/virtual_driver/win/virtual_driver_helpers.h" - -#include -#include - -#include - -#include "base/files/file_util.h" -#include "base/win/windows_version.h" -#include "cloud_print/common/win/cloud_print_utils.h" - -namespace cloud_print { - -void DisplayWindowsMessage(HWND hwnd, HRESULT hr, const std::wstring& caption) { - ::MessageBox(hwnd, GetErrorMessage(hr).c_str(), caption.c_str(), MB_OK); -} - -std::wstring GetPortMonitorDllName() { - if (IsSystem64Bit()) { - return std::wstring(L"gcp_portmon64.dll"); - } else { - return std::wstring(L"gcp_portmon.dll"); - } -} - -HRESULT GetPrinterDriverDir(base::FilePath* path) { - BYTE driver_dir_buffer[MAX_PATH * sizeof(wchar_t)]; - DWORD needed = 0; - if (!GetPrinterDriverDirectory(NULL, NULL, 1, driver_dir_buffer, - MAX_PATH * sizeof(wchar_t), &needed)) { - // We could try to allocate a larger buffer if needed > MAX_PATH - // but that really shouldn't happen. - return cloud_print::GetLastHResult(); - } - *path = base::FilePath(reinterpret_cast(driver_dir_buffer)); - - // The XPS driver is a "Level 3" driver - *path = path->Append(L"3"); - return S_OK; -} - -bool IsSystem64Bit() { - base::win::OSInfo::WindowsArchitecture arch = - base::win::OSInfo::GetArchitecture(); - return (arch == base::win::OSInfo::X64_ARCHITECTURE) || - (arch == base::win::OSInfo::IA64_ARCHITECTURE); -} -} // namespace cloud_print diff --git a/cloud_print/virtual_driver/win/virtual_driver_helpers.h b/cloud_print/virtual_driver/win/virtual_driver_helpers.h deleted file mode 100644 index 8d98d2a05323b6..00000000000000 --- a/cloud_print/virtual_driver/win/virtual_driver_helpers.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2011 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 CLOUD_PRINT_VIRTUAL_DRIVER_WIN_VIRTUAL_DRIVER_HELPERS_H_ -#define CLOUD_PRINT_VIRTUAL_DRIVER_WIN_VIRTUAL_DRIVER_HELPERS_H_ - -#include - -#include - - -namespace base { -class FilePath; -} - -namespace cloud_print { - -// Convert an HRESULT to a localized string and display it in a message box. -void DisplayWindowsMessage(HWND hwnd, - HRESULT hr, - const std::wstring& caption); - -// Returns the correct port monitor DLL file name for the current machine. -std::wstring GetPortMonitorDllName(); - -// Gets the standard install path for "version 3" print drivers. -HRESULT GetPrinterDriverDir(base::FilePath* path); - -// Returns TRUE if the current OS is 64 bit. -bool IsSystem64Bit(); - -} // namespace cloud_print - -#endif // CLOUD_PRINT_VIRTUAL_DRIVER_WIN_VIRTUAL_DRIVER_HELPERS_H_ diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 20afadaf38f594..5cc9e0cea31f56 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json @@ -26584,7 +26584,7 @@ }, { 'name': 'LocalDiscoveryEnabled', - 'owners': ['file://cloud_print/OWNERS', 'weili@chromium.org'], + 'owners': ['thestig@chromium.org', 'weili@chromium.org'], 'type': 'main', 'schema': { 'type': 'boolean' }, 'supported_on': ['chrome.*:81-87', 'chrome_os:81-87'], diff --git a/tools/grit/grit/testdata/tools/grit/resource_ids b/tools/grit/grit/testdata/tools/grit/resource_ids index 8a2b608df141fc..460bb5cdd5bb15 100644 --- a/tools/grit/grit/testdata/tools/grit/resource_ids +++ b/tools/grit/grit/testdata/tools/grit/resource_ids @@ -157,9 +157,6 @@ "META": {"join": 2}, "includes": [21500], }, - "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": { - "messages": [22500], - }, "chrome/browser/resources/quota_internals_resources.grd": { "includes": [23000], }, diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec index 22896db086972f..862a5fa7d1f388 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec @@ -823,11 +823,6 @@ "includes": [4180], }, - "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": { - "includes": [4200], - "messages": [4220], - }, - "device/bluetooth/bluetooth_strings.grd": { "messages": [4240], }, diff --git a/tools/gritsettings/translation_expectations.pyl b/tools/gritsettings/translation_expectations.pyl index 489c6725ec1623..ca720feeabe8a1 100644 --- a/tools/gritsettings/translation_expectations.pyl +++ b/tools/gritsettings/translation_expectations.pyl @@ -120,7 +120,6 @@ "chrome/app/resources/locale_settings_win.grd": "Not UI strings; localized separately", "chrome/test/data/chrome_test_resources.grd": "Test data", "chromecast/app/resources/chromecast_settings.grd": "Not UI strings; localized separately", - "cloud_print/virtual_driver/win/install/virtual_driver_setup_resources.grd": "Separate release process", "components/components_locale_settings.grd": "Not UI strings; localized separately", "components/omnibox/resources/omnibox_resources.grd": "Not UI strings; localized separately", "tools/grit/grit/testdata/allowlist_resources.grd": "Test data",