Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/chromeos/printing/specifics_translation.cc

Issue 2858353004: Track printer installations for each configuration. (Closed)
Patch Set: default argument Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698