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

Unified Diff: chrome/utility/importer/ie_importer_win.cc

Issue 800433002: Search for history items that was imported from IE is not working. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed some issues found by Gab@ Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/importer/ie_importer_browsertest_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/ie_importer_win.cc
diff --git a/chrome/utility/importer/ie_importer_win.cc b/chrome/utility/importer/ie_importer_win.cc
index 4865397260acaac1ecee67f5f757ed012bcac32a..36ba47c04dc32478c3a3c83d9cbf32780f15aa05 100644
--- a/chrome/utility/importer/ie_importer_win.cc
+++ b/chrome/utility/importer/ie_importer_win.cc
@@ -477,18 +477,18 @@ void IEImporter::ImportHistory() {
int total_schemes = arraysize(kSchemes);
base::win::ScopedComPtr<IUrlHistoryStg2> url_history_stg2;
- HRESULT result;
- result = url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL,
- CLSCTX_INPROC_SERVER);
- if (FAILED(result))
+ if (FAILED(url_history_stg2.CreateInstance(CLSID_CUrlHistory, NULL,
+ CLSCTX_INPROC_SERVER)))
return;
gab 2014/12/12 14:58:31 nit: Wrap in {} since conditional is multi-line.
Alexey Seren 2014/12/15 14:00:23 Acknowledged.
base::win::ScopedComPtr<IEnumSTATURL> enum_url;
- if (SUCCEEDED(result = url_history_stg2->EnumUrls(enum_url.Receive()))) {
+ if (SUCCEEDED(url_history_stg2->EnumUrls(enum_url.Receive()))) {
std::vector<ImporterURLRow> rows;
STATURL stat_url;
- ULONG fetched;
+
+ // Fill STATURL::dwFlags attribute for top-level items.
+ enum_url->SetFilter(NULL, STATURL_QUERYFLAG_TOPLEVEL);
while (!cancelled() &&
- (result = enum_url->Next(1, &stat_url, &fetched)) == S_OK) {
+ enum_url->Next(1, &stat_url, NULL) == S_OK) {
base::string16 url_string;
if (stat_url.pwcsUrl) {
url_string = stat_url.pwcsUrl;
@@ -510,7 +510,7 @@ void IEImporter::ImportHistory() {
ImporterURLRow row(url);
row.title = title_string;
row.last_visit = base::Time::FromFileTime(stat_url.ftLastVisited);
- if (stat_url.dwFlags == STATURL_QUERYFLAG_TOPLEVEL) {
+ if (stat_url.dwFlags & STATURLFLAG_ISTOPLEVEL) {
row.visit_count = 1;
row.hidden = false;
} else {
« no previous file with comments | « chrome/browser/importer/ie_importer_browsertest_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698