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

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

Issue 14824006: Revert 198820 "Move FileEnumerator to its own file, do some refa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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/importer/ie_importer.h" 5 #include "chrome/browser/importer/ie_importer.h"
6 6
7 #include <ole2.h> 7 #include <ole2.h>
8 #include <intshcut.h> 8 #include <intshcut.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 #include <urlhist.h> 10 #include <urlhist.h>
11 #include <wininet.h> 11 #include <wininet.h>
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <map> 14 #include <map>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "base/file_util.h" 18 #include "base/file_util.h"
19 #include "base/files/file_enumerator.h"
20 #include "base/files/file_path.h" 19 #include "base/files/file_path.h"
21 #include "base/string16.h" 20 #include "base/string16.h"
22 #include "base/string_util.h" 21 #include "base/string_util.h"
23 #include "base/strings/string_split.h" 22 #include "base/strings/string_split.h"
24 #include "base/time.h" 23 #include "base/time.h"
25 #include "base/utf_string_conversions.h" 24 #include "base/utf_string_conversions.h"
26 #include "base/win/registry.h" 25 #include "base/win/registry.h"
27 #include "base/win/scoped_co_mem.h" 26 #include "base/win/scoped_co_mem.h"
28 #include "base/win/scoped_comptr.h" 27 #include "base/win/scoped_comptr.h"
29 #include "base/win/scoped_handle.h" 28 #include "base/win/scoped_handle.h"
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 void IEImporter::ParseFavoritesFolder( 809 void IEImporter::ParseFavoritesFolder(
811 const FavoritesInfo& info, 810 const FavoritesInfo& info,
812 BookmarkVector* bookmarks, 811 BookmarkVector* bookmarks,
813 std::vector<history::ImportedFaviconUsage>* favicons) { 812 std::vector<history::ImportedFaviconUsage>* favicons) {
814 base::FilePath file; 813 base::FilePath file;
815 std::vector<base::FilePath::StringType> file_list; 814 std::vector<base::FilePath::StringType> file_list;
816 base::FilePath favorites_path(info.path); 815 base::FilePath favorites_path(info.path);
817 // Favorites path length. Make sure it doesn't include the trailing \. 816 // Favorites path length. Make sure it doesn't include the trailing \.
818 size_t favorites_path_len = 817 size_t favorites_path_len =
819 favorites_path.StripTrailingSeparators().value().size(); 818 favorites_path.StripTrailingSeparators().value().size();
820 base::FileEnumerator file_enumerator( 819 file_util::FileEnumerator file_enumerator(
821 favorites_path, true, base::FileEnumerator::FILES); 820 favorites_path, true, file_util::FileEnumerator::FILES);
822 while (!(file = file_enumerator.Next()).value().empty() && !cancelled()) 821 while (!(file = file_enumerator.Next()).value().empty() && !cancelled())
823 file_list.push_back(file.value()); 822 file_list.push_back(file.value());
824 823
825 // Keep the bookmarks in alphabetical order. 824 // Keep the bookmarks in alphabetical order.
826 std::sort(file_list.begin(), file_list.end()); 825 std::sort(file_list.begin(), file_list.end());
827 826
828 // Map from favicon URLs to the favicon data (the binary image data and the 827 // Map from favicon URLs to the favicon data (the binary image data and the
829 // set of bookmark URLs referring to the favicon). 828 // set of bookmark URLs referring to the favicon).
830 typedef std::map<GURL, history::ImportedFaviconUsage> FaviconMap; 829 typedef std::map<GURL, history::ImportedFaviconUsage> FaviconMap;
831 FaviconMap favicon_map; 830 FaviconMap favicon_map;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 static int version = -1; 892 static int version = -1;
894 if (version < 0) { 893 if (version < 0) {
895 wchar_t buffer[128]; 894 wchar_t buffer[128];
896 DWORD buffer_length = sizeof(buffer); 895 DWORD buffer_length = sizeof(buffer);
897 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ); 896 base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, kIEVersionKey, KEY_READ);
898 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); 897 LONG result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL);
899 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0); 898 version = ((result == ERROR_SUCCESS)? _wtoi(buffer) : 0);
900 } 899 }
901 return version; 900 return version;
902 } 901 }
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/importer/firefox3_importer.cc ('k') | trunk/src/chrome/browser/policy/config_dir_policy_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698