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

Side by Side Diff: components/cloud_devices/common/cloud_device_description.cc

Issue 294923005: Add media size capability to PDF printer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retrieve PDF printer capabilites via the same API as for any other local printer. Created 6 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 | Annotate | Revision Log
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 "components/cloud_devices/common/cloud_device_description.h" 5 #include "components/cloud_devices/common/cloud_device_description.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 return InitFromDictionary(make_scoped_ptr(description)); 44 return InitFromDictionary(make_scoped_ptr(description));
45 } 45 }
46 46
47 std::string CloudDeviceDescription::ToString() const { 47 std::string CloudDeviceDescription::ToString() const {
48 std::string json; 48 std::string json;
49 base::JSONWriter::WriteWithOptions( 49 base::JSONWriter::WriteWithOptions(
50 root_.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); 50 root_.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
51 return json; 51 return json;
52 } 52 }
53 53
54 scoped_ptr<base::DictionaryValue> CloudDeviceDescription::release() {
Vitaly Buka (NO REVIEWS) 2014/05/22 01:11:21 This object is invalid after this. You can just re
Aleksey Shlyapnikov 2014/05/22 03:51:18 Done.
55 return root_.Pass();
56 }
57
54 const base::DictionaryValue* CloudDeviceDescription::GetItem( 58 const base::DictionaryValue* CloudDeviceDescription::GetItem(
55 const std::string& path) const { 59 const std::string& path) const {
56 const base::DictionaryValue* value = NULL; 60 const base::DictionaryValue* value = NULL;
57 root_->GetDictionary(path, &value); 61 root_->GetDictionary(path, &value);
58 return value; 62 return value;
59 } 63 }
60 64
61 base::DictionaryValue* CloudDeviceDescription::CreateItem( 65 base::DictionaryValue* CloudDeviceDescription::CreateItem(
62 const std::string& path) { 66 const std::string& path) {
63 base::DictionaryValue* value = new base::DictionaryValue; 67 base::DictionaryValue* value = new base::DictionaryValue;
64 root_->Set(path, value); 68 root_->Set(path, value);
65 return value; 69 return value;
66 } 70 }
67 71
68 const base::ListValue* CloudDeviceDescription::GetListItem( 72 const base::ListValue* CloudDeviceDescription::GetListItem(
69 const std::string& path) const { 73 const std::string& path) const {
70 const base::ListValue* value = NULL; 74 const base::ListValue* value = NULL;
71 root_->GetList(path, &value); 75 root_->GetList(path, &value);
72 return value; 76 return value;
73 } 77 }
74 78
75 base::ListValue* CloudDeviceDescription::CreateListItem( 79 base::ListValue* CloudDeviceDescription::CreateListItem(
76 const std::string& path) { 80 const std::string& path) {
77 base::ListValue* value = new base::ListValue; 81 base::ListValue* value = new base::ListValue;
78 root_->Set(path, value); 82 root_->Set(path, value);
79 return value; 83 return value;
80 } 84 }
81 85
82 } // namespace cloud_devices 86 } // namespace cloud_devices
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698