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

Side by Side Diff: chrome/browser/dom_ui/dom_ui.cc

Issue 3117017: Remove deprecated wstring Get(As)String() methods from Value, etc. (Closed)
Patch Set: fix win Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser/dom_ui/dom_ui.h" 5 #include "chrome/browser/dom_ui/dom_ui.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const ListValue* list_value = static_cast<const ListValue*>(value); 169 const ListValue* list_value = static_cast<const ListValue*>(value);
170 std::string string_value; 170 std::string string_value;
171 if (list_value->GetString(0, &string_value)) { 171 if (list_value->GetString(0, &string_value)) {
172 base::StringToInt(string_value, out_int); 172 base::StringToInt(string_value, out_int);
173 return true; 173 return true;
174 } 174 }
175 } 175 }
176 return false; 176 return false;
177 } 177 }
178 178
179 // TODO(viettrungluu): convert to string16 (or UTF-8 std::string?).
179 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { 180 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) {
180 if (value && value->GetType() == Value::TYPE_LIST) { 181 if (value && value->GetType() == Value::TYPE_LIST) {
181 const ListValue* list_value = static_cast<const ListValue*>(value); 182 const ListValue* list_value = static_cast<const ListValue*>(value);
182 std::wstring wstring_value; 183 string16 string16_value;
183 if (list_value->GetString(0, &wstring_value)) 184 if (list_value->GetString(0, &string16_value))
184 return wstring_value; 185 return UTF16ToWideHack(string16_value);
185 } 186 }
186 return std::wstring(); 187 return std::wstring();
187 } 188 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/core_options_handler.cc ('k') | chrome/browser/extensions/extension_bookmarks_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698