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" |
(...skipping 30 matching lines...) Expand all Loading... |
41 specifics->set_effective_make_and_model(ref.effective_make_and_model); | 41 specifics->set_effective_make_and_model(ref.effective_make_and_model); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 } // namespace | 45 } // namespace |
46 | 46 |
47 std::unique_ptr<Printer> SpecificsToPrinter( | 47 std::unique_ptr<Printer> SpecificsToPrinter( |
48 const sync_pb::PrinterSpecifics& specifics) { | 48 const sync_pb::PrinterSpecifics& specifics) { |
49 DCHECK(!specifics.id().empty()); | 49 DCHECK(!specifics.id().empty()); |
50 | 50 |
51 auto printer = base::MakeUnique<Printer>(specifics.id()); | 51 auto printer = |
| 52 base::MakeUnique<Printer>(specifics.id(), specifics.updated_timestamp()); |
52 printer->set_display_name(specifics.display_name()); | 53 printer->set_display_name(specifics.display_name()); |
53 printer->set_description(specifics.description()); | 54 printer->set_description(specifics.description()); |
54 printer->set_manufacturer(specifics.manufacturer()); | 55 printer->set_manufacturer(specifics.manufacturer()); |
55 printer->set_model(specifics.model()); | 56 printer->set_model(specifics.model()); |
56 printer->set_uri(specifics.uri()); | 57 printer->set_uri(specifics.uri()); |
57 printer->set_uuid(specifics.uuid()); | 58 printer->set_uuid(specifics.uuid()); |
58 | 59 |
59 *printer->mutable_ppd_reference() = SpecificsToPpd(specifics.ppd_reference()); | 60 *printer->mutable_ppd_reference() = SpecificsToPpd(specifics.ppd_reference()); |
60 | 61 |
61 return printer; | 62 return printer; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 94 |
94 if (!printer.uuid().empty()) | 95 if (!printer.uuid().empty()) |
95 specifics->set_uuid(printer.uuid()); | 96 specifics->set_uuid(printer.uuid()); |
96 | 97 |
97 MergeReferenceToSpecifics(specifics->mutable_ppd_reference(), | 98 MergeReferenceToSpecifics(specifics->mutable_ppd_reference(), |
98 printer.ppd_reference()); | 99 printer.ppd_reference()); |
99 } | 100 } |
100 | 101 |
101 } // namespace printing | 102 } // namespace printing |
102 } // namespace chromeos | 103 } // namespace chromeos |
OLD | NEW |