OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "chrome/browser/chromeos/printing/specifics_translation.h" | 14 #include "chrome/browser/chromeos/printing/specifics_translation.h" |
15 #include "chromeos/printing/printer_configuration.h" | 15 #include "chromeos/printing/printer_configuration.h" |
16 #include "components/sync/protocol/printer_specifics.pb.h" | 16 #include "components/sync/protocol/printer_specifics.pb.h" |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 namespace printing { | |
20 | 19 |
21 namespace { | 20 namespace { |
22 | 21 |
23 Printer::PpdReference SpecificsToPpd( | 22 Printer::PpdReference SpecificsToPpd( |
24 const sync_pb::PrinterPPDReference& specifics) { | 23 const sync_pb::PrinterPPDReference& specifics) { |
25 Printer::PpdReference ref; | 24 Printer::PpdReference ref; |
26 if (specifics.autoconf()) { | 25 if (specifics.autoconf()) { |
27 ref.autoconf = specifics.autoconf(); | 26 ref.autoconf = specifics.autoconf(); |
28 } else if (specifics.has_user_supplied_ppd_url()) { | 27 } else if (specifics.has_user_supplied_ppd_url()) { |
29 ref.user_supplied_ppd_url = specifics.user_supplied_ppd_url(); | 28 ref.user_supplied_ppd_url = specifics.user_supplied_ppd_url(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (!printer.uri().empty()) | 117 if (!printer.uri().empty()) |
119 specifics->set_uri(printer.uri()); | 118 specifics->set_uri(printer.uri()); |
120 | 119 |
121 if (!printer.uuid().empty()) | 120 if (!printer.uuid().empty()) |
122 specifics->set_uuid(printer.uuid()); | 121 specifics->set_uuid(printer.uuid()); |
123 | 122 |
124 MergeReferenceToSpecifics(specifics->mutable_ppd_reference(), | 123 MergeReferenceToSpecifics(specifics->mutable_ppd_reference(), |
125 printer.ppd_reference()); | 124 printer.ppd_reference()); |
126 } | 125 } |
127 | 126 |
128 } // namespace printing | |
129 } // namespace chromeos | 127 } // namespace chromeos |
OLD | NEW |