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

Side by Side Diff: base/value_conversions.cc

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 years, 4 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
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/values.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/value_conversions.h" 5 #include "base/value_conversions.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 19 matching lines...) Expand all
30 result = SysWideToNativeMB(UTF8ToWide(str)); 30 result = SysWideToNativeMB(UTF8ToWide(str));
31 #elif defined(OS_WIN) 31 #elif defined(OS_WIN)
32 result = UTF8ToUTF16(str); 32 result = UTF8ToUTF16(str);
33 #endif 33 #endif
34 return FilePath(result); 34 return FilePath(result);
35 } 35 }
36 36
37 } // namespace 37 } // namespace
38 38
39 StringValue* CreateFilePathValue(const FilePath& in_value) { 39 StringValue* CreateFilePathValue(const FilePath& in_value) {
40 return new StringValue(FilePathToUTF8(in_value)); 40 return StringValue::New(FilePathToUTF8(in_value));
41 } 41 }
42 42
43 bool GetValueAsFilePath(const Value& value, FilePath* file_path) { 43 bool GetValueAsFilePath(const Value& value, FilePath* file_path) {
44 std::string str; 44 std::string str;
45 if (!value.GetAsString(&str)) 45 if (!value.GetAsString(&str))
46 return false; 46 return false;
47 if (file_path) 47 if (file_path)
48 *file_path = UTF8ToFilePath(str); 48 *file_path = UTF8ToFilePath(str);
49 return true; 49 return true;
50 } 50 }
51 51
52 } // namespace base 52 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/values.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698