summaryrefslogtreecommitdiffstats
path: root/chrome/service
diff options
context:
space:
mode:
authorvollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-09 04:11:52 +0000
committervollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-09 04:11:52 +0000
commit9051bf921654c332fef4a638a1a95752343bda19 (patch)
tree44ced2f1d47deb9f3a17d6f7dc484b9f6e30e898 /chrome/service
parentf74d7ed2fd9792ed79b26a6512e7ba3df5f90eef (diff)
downloadchromium_src-9051bf921654c332fef4a638a1a95752343bda19.zip
chromium_src-9051bf921654c332fef4a638a1a95752343bda19.tar.gz
chromium_src-9051bf921654c332fef4a638a1a95752343bda19.tar.bz2
Revert 249967 "Printer registration using CDD."
> Printer registration using CDD. > The code is not enabled yet. > > BUG=317027 > > Review URL: https://codereview.chromium.org/148203011 TBR=vitalybuka@chromium.org Review URL: https://codereview.chromium.org/150243004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service')
-rw-r--r--chrome/service/cloud_print/DEPS1
-rw-r--r--chrome/service/cloud_print/cdd_conversion_win.cc113
-rw-r--r--chrome/service/cloud_print/cdd_conversion_win.h21
-rw-r--r--chrome/service/cloud_print/cloud_print_connector.cc4
-rw-r--r--chrome/service/cloud_print/print_system_win.cc44
-rw-r--r--chrome/service/cloud_print/printer_job_handler.cc4
6 files changed, 3 insertions, 184 deletions
diff --git a/chrome/service/cloud_print/DEPS b/chrome/service/cloud_print/DEPS
index eede8f5..52393c8 100644
--- a/chrome/service/cloud_print/DEPS
+++ b/chrome/service/cloud_print/DEPS
@@ -1,5 +1,4 @@
include_rules = [
- "+components/cloud_devices",
# sync notifier depends on the common jingle notifier classes.
"+jingle/notifier",
]
diff --git a/chrome/service/cloud_print/cdd_conversion_win.cc b/chrome/service/cloud_print/cdd_conversion_win.cc
deleted file mode 100644
index 2c7a9a4..0000000
--- a/chrome/service/cloud_print/cdd_conversion_win.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright 2014 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/service/cloud_print/cdd_conversion_win.h"
-
-#include "components/cloud_devices/printer_description.h"
-#include "printing/backend/print_backend.h"
-#include "printing/backend/win_helper.h"
-
-namespace cloud_print {
-
-std::string CapabilitiesToCdd(
- const printing::PrinterSemanticCapsAndDefaults& semantic_info) {
- using namespace cloud_devices::printer;
- cloud_devices::CloudDeviceDescription description;
-
- ContentTypesCapability content_types;
- content_types.AddOption("application/pdf");
- content_types.SaveTo(&description);
-
- ColorCapability color;
- if (semantic_info.color_default || semantic_info.color_changeable) {
- color.AddDefaultOption(Color(STANDARD_COLOR), semantic_info.color_default);
- }
-
- if (!semantic_info.color_default || semantic_info.color_changeable) {
- color.AddDefaultOption(Color(STANDARD_MONOCHROME),
- !semantic_info.color_default);
- }
- color.SaveTo(&description);
-
- if (semantic_info.duplex_capable) {
- DuplexCapability duplex;
- duplex.AddDefaultOption(
- NO_DUPLEX, semantic_info.duplex_default == printing::SIMPLEX);
- duplex.AddDefaultOption(
- LONG_EDGE, semantic_info.duplex_default == printing::LONG_EDGE);
- duplex.AddDefaultOption(
- SHORT_EDGE, semantic_info.duplex_default == printing::SHORT_EDGE);
- duplex.SaveTo(&description);
- }
-
- if (!semantic_info.papers.empty()) {
- Media default_media(semantic_info.default_paper.name,
- semantic_info.default_paper.size_um.width(),
- semantic_info.default_paper.size_um.height());
- default_media.MatchBySize();
-
- MediaCapability media;
- bool is_default_set = false;
- for (size_t i = 0; i < semantic_info.papers.size(); ++i) {
- gfx::Size paper_size = semantic_info.papers[i].size_um;
- if (paper_size.width() > paper_size.height())
- paper_size.SetSize(paper_size.height(), paper_size.width());
- Media new_media(semantic_info.papers[i].name, paper_size.width(),
- paper_size.height());
- new_media.MatchBySize();
- if (new_media.IsValid() && !media.Contains(new_media)) {
- if (!default_media.IsValid())
- default_media = new_media;
- media.AddDefaultOption(new_media, new_media == default_media);
- is_default_set = is_default_set || (new_media == default_media);
- }
- }
- if (!is_default_set && default_media.IsValid())
- media.AddDefaultOption(default_media, true);
-
- if (media.IsValid()) {
- media.SaveTo(&description);
- } else {
- NOTREACHED();
- }
- }
-
- if (semantic_info.collate_capable) {
- CollateCapability collate;
- collate.set_default_value(semantic_info.collate_default);
- collate.SaveTo(&description);
- }
-
- if (semantic_info.copies_capable) {
- CopiesCapability copies;
- copies.SaveTo(&description);
- }
-
- if (!semantic_info.dpis.empty()) {
- DpiCapability dpi;
- Dpi default_dpi(semantic_info.default_dpi.width(),
- semantic_info.default_dpi.height());
- bool is_default_set = false;
- for (size_t i = 0; i < semantic_info.dpis.size(); ++i) {
- Dpi new_dpi(semantic_info.dpis[i].width(),
- semantic_info.dpis[i].height());
- if (new_dpi.IsValid() && !dpi.Contains(new_dpi)) {
- if (!default_dpi.IsValid())
- default_dpi = new_dpi;
- dpi.AddDefaultOption(new_dpi, new_dpi == default_dpi);
- is_default_set = is_default_set || (new_dpi == default_dpi);
- }
- }
- if (!is_default_set && default_dpi.IsValid())
- dpi.AddDefaultOption(default_dpi, true);
- if (dpi.IsValid()) {
- dpi.SaveTo(&description);
- } else {
- NOTREACHED();
- }
- }
- return description.ToString();
-}
-
-} // namespace cloud_print
diff --git a/chrome/service/cloud_print/cdd_conversion_win.h b/chrome/service/cloud_print/cdd_conversion_win.h
deleted file mode 100644
index 0855922..0000000
--- a/chrome/service/cloud_print/cdd_conversion_win.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_SERVICE_CLOUD_PRINT_CDD_CONVERSION_WIN_H_
-#define CHROME_SERVICE_CLOUD_PRINT_CDD_CONVERSION_WIN_H_
-
-#include <string>
-
-namespace printing {
-struct PrinterSemanticCapsAndDefaults;
-}
-
-namespace cloud_print {
-
-std::string CapabilitiesToCdd(
- const printing::PrinterSemanticCapsAndDefaults& semantic_info);
-
-} // namespace cloud_print
-
-#endif // CHROME_SERVICE_CLOUD_PRINT_CDD_CONVERSION_WIN_H_
diff --git a/chrome/service/cloud_print/cloud_print_connector.cc b/chrome/service/cloud_print/cloud_print_connector.cc
index 94c18f0..03687d8 100644
--- a/chrome/service/cloud_print/cloud_print_connector.cc
+++ b/chrome/service/cloud_print/cloud_print_connector.cc
@@ -622,10 +622,6 @@ void CloudPrintConnector::OnReceivePrinterCaps(
settings_.xmpp_ping_timeout_sec()),
mime_boundary, std::string(), &post_data);
post_data += GetPostDataForPrinterInfo(info, mime_boundary);
- if (caps_and_defaults.caps_mime_type == kContentTypeCDD) {
- net::AddMultipartValueForUpload(kUseCDD, "true", mime_boundary,
- std::string(), &post_data);
- }
net::AddMultipartValueForUpload(kPrinterCapsValue,
caps_and_defaults.printer_capabilities, mime_boundary,
caps_and_defaults.caps_mime_type, &post_data);
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc
index 36891b8..e66c9d1 100644
--- a/chrome/service/cloud_print/print_system_win.cc
+++ b/chrome/service/cloud_print/print_system_win.cc
@@ -13,7 +13,6 @@
#include "base/win/scoped_hdc.h"
#include "chrome/common/cloud_print/cloud_print_constants.h"
#include "chrome/common/crash_keys.h"
-#include "chrome/service/cloud_print/cdd_conversion_win.h"
#include "chrome/service/service_process.h"
#include "chrome/service/service_utility_process_host.h"
#include "grit/generated_resources.h"
@@ -621,35 +620,15 @@ class PrinterCapsHandler : public ServiceUtilityProcessHost::Client {
Release();
}
- virtual void OnGetPrinterSemanticCapsAndDefaults(
- bool succeeded,
- const std::string& printer_name,
- const printing::PrinterSemanticCapsAndDefaults& semantic_info) OVERRIDE {
- printing::PrinterCapsAndDefaults printer_info;
- if (succeeded) {
- printer_info.caps_mime_type = kContentTypeCDD;
- printer_info.printer_capabilities = CapabilitiesToCdd(semantic_info);
- }
- callback_.Run(succeeded, printer_name, printer_info);
- callback_.Reset();
- Release();
- }
-
- void StartGetPrinterCapsAndDefaults() {
+ void Start() {
g_service_process->io_thread()->message_loop_proxy()->PostTask(
FROM_HERE,
base::Bind(&PrinterCapsHandler::GetPrinterCapsAndDefaultsImpl, this,
base::MessageLoopProxy::current()));
}
- void StartGetPrinterSemanticCapsAndDefaults() {
- g_service_process->io_thread()->message_loop_proxy()->PostTask(
- FROM_HERE,
- base::Bind(&PrinterCapsHandler::GetPrinterSemanticCapsAndDefaultsImpl,
- this, base::MessageLoopProxy::current()));
- }
-
private:
+ // Called on the service process IO thread.
void GetPrinterCapsAndDefaultsImpl(
const scoped_refptr<base::MessageLoopProxy>&
client_message_loop_proxy) {
@@ -667,23 +646,6 @@ class PrinterCapsHandler : public ServiceUtilityProcessHost::Client {
}
}
- void GetPrinterSemanticCapsAndDefaultsImpl(
- const scoped_refptr<base::MessageLoopProxy>&
- client_message_loop_proxy) {
- DCHECK(g_service_process->io_thread()->message_loop_proxy()->
- BelongsToCurrentThread());
- scoped_ptr<ServiceUtilityProcessHost> utility_host(
- new ServiceUtilityProcessHost(this, client_message_loop_proxy));
- if (utility_host->StartGetPrinterSemanticCapsAndDefaults(printer_name_)) {
- // The object will self-destruct when the child process dies.
- utility_host.release();
- } else {
- client_message_loop_proxy->PostTask(
- FROM_HERE,
- base::Bind(&PrinterCapsHandler::OnChildDied, this));
- }
- }
-
std::string printer_name_;
PrintSystem::PrinterCapsAndDefaultsCallback callback_;
};
@@ -752,7 +714,7 @@ void PrintSystemWin::GetPrinterCapsAndDefaults(
PrinterCapsHandler* handler =
new PrinterCapsHandler(printer_name, callback);
handler->AddRef();
- handler->StartGetPrinterCapsAndDefaults();
+ handler->Start();
}
bool PrintSystemWin::IsValidPrinter(const std::string& printer_name) {
diff --git a/chrome/service/cloud_print/printer_job_handler.cc b/chrome/service/cloud_print/printer_job_handler.cc
index 0e8a3f8..e7c1f14 100644
--- a/chrome/service/cloud_print/printer_job_handler.cc
+++ b/chrome/service/cloud_print/printer_job_handler.cc
@@ -683,10 +683,6 @@ void PrinterJobHandler::OnReceivePrinterCaps(
// Hashes don't match, we need to upload new capabilities (the defaults
// go for free along with the capabilities)
printer_info_cloud_.caps_hash = caps_hash;
- if (caps_and_defaults.caps_mime_type == kContentTypeCDD) {
- net::AddMultipartValueForUpload(kUseCDD, "true", mime_boundary,
- std::string(), &post_data);
- }
net::AddMultipartValueForUpload(kPrinterCapsValue,
caps_and_defaults.printer_capabilities, mime_boundary,
caps_and_defaults.caps_mime_type, &post_data);