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

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

Issue 13315: Move file enumeration to filepaths. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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) 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/ie_importer.h" 5 #include "chrome/browser/importer/ie_importer.h"
6 6
7 #include <intshcut.h> 7 #include <intshcut.h>
8 #include <pstore.h> 8 #include <pstore.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #include <urlhist.h> 10 #include <urlhist.h>
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 info->links_folder = L"Links"; 462 info->links_folder = L"Links";
463 } 463 }
464 464
465 return true; 465 return true;
466 } 466 }
467 467
468 void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info, 468 void IEImporter::ParseFavoritesFolder(const FavoritesInfo& info,
469 BookmarkVector* bookmarks) { 469 BookmarkVector* bookmarks) {
470 std::wstring ie_folder = l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_IE); 470 std::wstring ie_folder = l10n_util::GetString(IDS_BOOKMARK_GROUP_FROM_IE);
471 BookmarkVector toolbar_bookmarks; 471 BookmarkVector toolbar_bookmarks;
472 std::wstring file; 472 FilePath file;
473 std::vector<std::wstring> file_list; 473 std::vector<std::wstring> file_list;
474 file_util::FileEnumerator file_enumerator(info.path, true, 474 file_util::FileEnumerator file_enumerator(
475 FilePath::FromWStringHack(info.path), true,
475 file_util::FileEnumerator::FILES); 476 file_util::FileEnumerator::FILES);
476 while (!(file = file_enumerator.Next()).empty() && !cancelled()) 477 while (!(file = file_enumerator.Next()).value().empty() && !cancelled())
477 file_list.push_back(file); 478 file_list.push_back(file.ToWStringHack());
478 479
479 // Keep the bookmarks in alphabetical order. 480 // Keep the bookmarks in alphabetical order.
480 std::sort(file_list.begin(), file_list.end()); 481 std::sort(file_list.begin(), file_list.end());
481 482
482 for (std::vector<std::wstring>::iterator it = file_list.begin(); 483 for (std::vector<std::wstring>::iterator it = file_list.begin();
483 it != file_list.end(); ++it) { 484 it != file_list.end(); ++it) {
484 std::wstring filename = file_util::GetFilenameFromPath(*it); 485 std::wstring filename = file_util::GetFilenameFromPath(*it);
485 std::wstring extension = file_util::GetFileExtensionFromPath(filename); 486 std::wstring extension = file_util::GetFileExtensionFromPath(filename);
486 if (!LowerCaseEqualsASCII(extension, "url")) 487 if (!LowerCaseEqualsASCII(extension, "url"))
487 continue; 488 continue;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 if (version < 0) { 554 if (version < 0) {
554 wchar_t buffer[128]; 555 wchar_t buffer[128];
555 DWORD buffer_length = sizeof(buffer); 556 DWORD buffer_length = sizeof(buffer);
556 bool result = ReadFromRegistry(HKEY_LOCAL_MACHINE, 557 bool result = ReadFromRegistry(HKEY_LOCAL_MACHINE,
557 L"Software\\Microsoft\\Internet Explorer", 558 L"Software\\Microsoft\\Internet Explorer",
558 L"Version", buffer, &buffer_length); 559 L"Version", buffer, &buffer_length);
559 version = (result ? _wtoi(buffer) : 0); 560 version = (result ? _wtoi(buffer) : 0);
560 } 561 }
561 return version; 562 return version;
562 } 563 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/firefox2_importer.cc ('k') | chrome/browser/printing/printing_layout_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698