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

Side by Side Diff: components/policy/core/common/mac_util.cc

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweaks Created 6 years, 5 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/policy/core/common/mac_util.h" 5 #include "components/policy/core/common/mac_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 int int_value = 0; 65 int int_value = 0;
66 if (CFNumberGetValue(number, kCFNumberIntType, &int_value)) { 66 if (CFNumberGetValue(number, kCFNumberIntType, &int_value)) {
67 return scoped_ptr<base::Value>( 67 return scoped_ptr<base::Value>(
68 base::Value::CreateIntegerValue(int_value)); 68 base::Value::CreateIntegerValue(int_value));
69 } 69 }
70 } 70 }
71 } 71 }
72 72
73 if (CFStringRef string = CFCast<CFStringRef>(property)) { 73 if (CFStringRef string = CFCast<CFStringRef>(property)) {
74 return scoped_ptr<base::Value>( 74 return scoped_ptr<base::Value>(
75 base::Value::CreateStringValue(base::SysCFStringRefToUTF8(string))); 75 new base::StringValue(base::SysCFStringRefToUTF8(string)));
76 } 76 }
77 77
78 if (CFDictionaryRef dict = CFCast<CFDictionaryRef>(property)) { 78 if (CFDictionaryRef dict = CFCast<CFDictionaryRef>(property)) {
79 scoped_ptr<base::DictionaryValue> dict_value(new base::DictionaryValue()); 79 scoped_ptr<base::DictionaryValue> dict_value(new base::DictionaryValue());
80 CFDictionaryApplyFunction(dict, DictionaryEntryToValue, dict_value.get()); 80 CFDictionaryApplyFunction(dict, DictionaryEntryToValue, dict_value.get());
81 return dict_value.PassAs<base::Value>(); 81 return dict_value.PassAs<base::Value>();
82 } 82 }
83 83
84 if (CFArrayRef array = CFCast<CFArrayRef>(property)) { 84 if (CFArrayRef array = CFCast<CFArrayRef>(property)) {
85 scoped_ptr<base::ListValue> list_value(new base::ListValue()); 85 scoped_ptr<base::ListValue> list_value(new base::ListValue());
86 CFArrayApplyFunction(array, 86 CFArrayApplyFunction(array,
87 CFRangeMake(0, CFArrayGetCount(array)), 87 CFRangeMake(0, CFArrayGetCount(array)),
88 ArrayEntryToValue, 88 ArrayEntryToValue,
89 list_value.get()); 89 list_value.get());
90 return list_value.PassAs<base::Value>(); 90 return list_value.PassAs<base::Value>();
91 } 91 }
92 92
93 return scoped_ptr<base::Value>(); 93 return scoped_ptr<base::Value>();
94 } 94 }
95 95
96 } // namespace policy 96 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698