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

Side by Side Diff: chrome/browser/importer/firefox2_importer.cc

Issue 271099: Re-try r29078: Remove some deprecated file_util wstring functions. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/browser/first_run_win.cc ('k') | chrome/browser/importer/firefox3_importer.cc » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/importer/firefox2_importer.h" 5 #include "chrome/browser/importer/firefox2_importer.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/i18n/icu_string_conversions.h" 10 #include "base/i18n/icu_string_conversions.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Initializes NSS3. 284 // Initializes NSS3.
285 NSSDecryptor decryptor; 285 NSSDecryptor decryptor;
286 if (!decryptor.Init(source_path_, source_path_) && 286 if (!decryptor.Init(source_path_, source_path_) &&
287 !decryptor.Init(app_path_, source_path_)) 287 !decryptor.Init(app_path_, source_path_))
288 return; 288 return;
289 289
290 // Firefox 2 uses signons2.txt to store the pssswords. If it doesn't 290 // Firefox 2 uses signons2.txt to store the pssswords. If it doesn't
291 // exist, we try to find its older version. 291 // exist, we try to find its older version.
292 std::wstring file = source_path_; 292 std::wstring file = source_path_;
293 file_util::AppendToPath(&file, L"signons2.txt"); 293 file_util::AppendToPath(&file, L"signons2.txt");
294 if (!file_util::PathExists(file)) { 294 if (!file_util::PathExists(FilePath::FromWStringHack(file))) {
295 file = source_path_; 295 file = source_path_;
296 file_util::AppendToPath(&file, L"signons.txt"); 296 file_util::AppendToPath(&file, L"signons.txt");
297 } 297 }
298 298
299 std::string content; 299 std::string content;
300 file_util::ReadFileToString(file, &content); 300 file_util::ReadFileToString(file, &content);
301 std::vector<PasswordForm> forms; 301 std::vector<PasswordForm> forms;
302 decryptor.ParseSignons(content, &forms); 302 decryptor.ParseSignons(content, &forms);
303 303
304 if (!cancelled()) { 304 if (!cancelled()) {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 568
569 // We need to make up a URL for the favicon. We use a version of the page's 569 // We need to make up a URL for the favicon. We use a version of the page's
570 // URL so that we can be sure it will not collide. 570 // URL so that we can be sure it will not collide.
571 usage.favicon_url = GURL(std::string("made-up-favicon:") + link_url.spec()); 571 usage.favicon_url = GURL(std::string("made-up-favicon:") + link_url.spec());
572 572
573 // We only have one URL per favicon for Firefox 2 bookmarks. 573 // We only have one URL per favicon for Firefox 2 bookmarks.
574 usage.urls.insert(link_url); 574 usage.urls.insert(link_url);
575 575
576 favicons->push_back(usage); 576 favicons->push_back(usage);
577 } 577 }
OLDNEW
« no previous file with comments | « chrome/browser/first_run_win.cc ('k') | chrome/browser/importer/firefox3_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698