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

Side by Side Diff: chrome/common/cloud_print/cloud_print_cdd_conversion.cc

Issue 1880143002: Convert chrome/common to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/common/cloud_print/cloud_print_cdd_conversion.h" 5 #include "chrome/common/cloud_print/cloud_print_cdd_conversion.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory>
10
9 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
10 #include "components/cloud_devices/common/printer_description.h" 12 #include "components/cloud_devices/common/printer_description.h"
11 #include "printing/backend/print_backend.h" 13 #include "printing/backend/print_backend.h"
12 14
13 namespace cloud_print { 15 namespace cloud_print {
14 16
15 scoped_ptr<base::DictionaryValue> PrinterSemanticCapsAndDefaultsToCdd( 17 std::unique_ptr<base::DictionaryValue> PrinterSemanticCapsAndDefaultsToCdd(
16 const printing::PrinterSemanticCapsAndDefaults& semantic_info) { 18 const printing::PrinterSemanticCapsAndDefaults& semantic_info) {
17 using namespace cloud_devices::printer; 19 using namespace cloud_devices::printer;
18 cloud_devices::CloudDeviceDescription description; 20 cloud_devices::CloudDeviceDescription description;
19 21
20 ContentTypesCapability content_types; 22 ContentTypesCapability content_types;
21 content_types.AddOption("application/pdf"); 23 content_types.AddOption("application/pdf");
22 content_types.SaveTo(&description); 24 content_types.SaveTo(&description);
23 25
24 if (semantic_info.collate_capable) { 26 if (semantic_info.collate_capable) {
25 CollateCapability collate; 27 CollateCapability collate;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 NOTREACHED(); 116 NOTREACHED();
115 } 117 }
116 } 118 }
117 119
118 OrientationCapability orientation; 120 OrientationCapability orientation;
119 orientation.AddDefaultOption(PORTRAIT, true); 121 orientation.AddDefaultOption(PORTRAIT, true);
120 orientation.AddOption(LANDSCAPE); 122 orientation.AddOption(LANDSCAPE);
121 orientation.AddOption(AUTO_ORIENTATION); 123 orientation.AddOption(AUTO_ORIENTATION);
122 orientation.SaveTo(&description); 124 orientation.SaveTo(&description);
123 125
124 return scoped_ptr<base::DictionaryValue>(description.root().DeepCopy()); 126 return std::unique_ptr<base::DictionaryValue>(description.root().DeepCopy());
125 } 127 }
126 128
127 } // namespace cloud_print 129 } // namespace cloud_print
OLDNEW
« no previous file with comments | « chrome/common/cloud_print/cloud_print_cdd_conversion.h ('k') | chrome/common/cloud_print/cloud_print_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698