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

Side by Side Diff: chrome/browser/extensions/external_pref_loader.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/external_pref_loader.h" 5 #include "chrome/browser/extensions/external_pref_loader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 // For each file read the json description & build the proper 204 // For each file read the json description & build the proper
205 // associated prefs. 205 // associated prefs.
206 for (std::set<base::FilePath>::const_iterator it = candidates.begin(); 206 for (std::set<base::FilePath>::const_iterator it = candidates.begin();
207 it != candidates.end(); 207 it != candidates.end();
208 ++it) { 208 ++it) {
209 base::FilePath extension_candidate_path = base_path_.Append(*it); 209 base::FilePath extension_candidate_path = base_path_.Append(*it);
210 210
211 std::string id = 211 std::string id =
212 #if defined(OS_WIN) 212 #if defined(OS_WIN)
213 WideToASCII( 213 base::UTF16ToASCII(
214 extension_candidate_path.RemoveExtension().BaseName().value()); 214 extension_candidate_path.RemoveExtension().BaseName().value());
215 #elif defined(OS_POSIX) 215 #elif defined(OS_POSIX)
216 extension_candidate_path.RemoveExtension().BaseName().value().c_str(); 216 extension_candidate_path.RemoveExtension().BaseName().value().c_str();
217 #endif 217 #endif
218 218
219 DVLOG(1) << "Reading json file: " 219 DVLOG(1) << "Reading json file: "
220 << extension_candidate_path.LossyDisplayName().c_str(); 220 << extension_candidate_path.LossyDisplayName().c_str();
221 221
222 JSONFileValueSerializer serializer(extension_candidate_path); 222 JSONFileValueSerializer serializer(extension_candidate_path);
223 scoped_ptr<base::DictionaryValue> ext_prefs( 223 scoped_ptr<base::DictionaryValue> ext_prefs(
(...skipping 21 matching lines...) Expand all
245 LoadFinished(); 245 LoadFinished();
246 } 246 }
247 247
248 ExternalTestingLoader::~ExternalTestingLoader() {} 248 ExternalTestingLoader::~ExternalTestingLoader() {}
249 249
250 const base::FilePath ExternalTestingLoader::GetBaseCrxFilePath() { 250 const base::FilePath ExternalTestingLoader::GetBaseCrxFilePath() {
251 return fake_base_path_; 251 return fake_base_path_;
252 } 252 }
253 253
254 } // extensions 254 } // extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/proxy/proxy_api_helpers.cc ('k') | chrome/browser/extensions/external_registry_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698