OLD | NEW |
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/history/history_backend.h" | 5 #include "chrome/browser/history/history_backend.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 url_info.set_title(UTF8ToUTF16(url.spec())); | 1051 url_info.set_title(UTF8ToUTF16(url.spec())); |
1052 } | 1052 } |
1053 | 1053 |
1054 url_info.set_last_visit(Time::Now()); | 1054 url_info.set_last_visit(Time::Now()); |
1055 // Mark the page hidden. If the user types it in, it'll unhide. | 1055 // Mark the page hidden. If the user types it in, it'll unhide. |
1056 url_info.set_hidden(true); | 1056 url_info.set_hidden(true); |
1057 | 1057 |
1058 db_->AddURL(url_info); | 1058 db_->AddURL(url_info); |
1059 } | 1059 } |
1060 | 1060 |
1061 void HistoryBackend::IterateURLs(HistoryService::URLEnumerator* iterator) { | 1061 void HistoryBackend::IterateURLs( |
| 1062 const scoped_refptr<VisitedLinkDelegate::URLEnumerator>& iterator) { |
1062 if (db_.get()) { | 1063 if (db_.get()) { |
1063 HistoryDatabase::URLEnumerator e; | 1064 HistoryDatabase::URLEnumerator e; |
1064 if (db_->InitURLEnumeratorForEverything(&e)) { | 1065 if (db_->InitURLEnumeratorForEverything(&e)) { |
1065 URLRow info; | 1066 URLRow info; |
1066 while (e.GetNextURL(&info)) { | 1067 while (e.GetNextURL(&info)) { |
1067 iterator->OnURL(info); | 1068 iterator->OnURL(info.url()); |
1068 } | 1069 } |
1069 iterator->OnComplete(true); // Success. | 1070 iterator->OnComplete(true); // Success. |
1070 return; | 1071 return; |
1071 } | 1072 } |
1072 } | 1073 } |
1073 iterator->OnComplete(false); // Failure. | 1074 iterator->OnComplete(false); // Failure. |
1074 } | 1075 } |
1075 | 1076 |
1076 bool HistoryBackend::GetAllTypedURLs(URLRows* urls) { | 1077 bool HistoryBackend::GetAllTypedURLs(URLRows* urls) { |
1077 if (db_.get()) | 1078 if (db_.get()) |
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 info.url_id = visit.url_id; | 2977 info.url_id = visit.url_id; |
2977 info.time = visit.visit_time; | 2978 info.time = visit.visit_time; |
2978 info.transition = visit.transition; | 2979 info.transition = visit.transition; |
2979 // If we don't have a delegate yet during setup or shutdown, we will drop | 2980 // If we don't have a delegate yet during setup or shutdown, we will drop |
2980 // these notifications. | 2981 // these notifications. |
2981 if (delegate_.get()) | 2982 if (delegate_.get()) |
2982 delegate_->NotifyVisitDBObserversOnAddVisit(info); | 2983 delegate_->NotifyVisitDBObserversOnAddVisit(info); |
2983 } | 2984 } |
2984 | 2985 |
2985 } // namespace history | 2986 } // namespace history |
OLD | NEW |