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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 1061 void HistoryBackend::IterateURLs( |
1062 const scoped_refptr<VisitedLinkDelegate::URLEnumerator>& iterator) { | 1062 const scoped_refptr<components::VisitedLinkDelegate::URLEnumerator>& |
| 1063 iterator) { |
1063 if (db_.get()) { | 1064 if (db_.get()) { |
1064 HistoryDatabase::URLEnumerator e; | 1065 HistoryDatabase::URLEnumerator e; |
1065 if (db_->InitURLEnumeratorForEverything(&e)) { | 1066 if (db_->InitURLEnumeratorForEverything(&e)) { |
1066 URLRow info; | 1067 URLRow info; |
1067 while (e.GetNextURL(&info)) { | 1068 while (e.GetNextURL(&info)) { |
1068 iterator->OnURL(info.url()); | 1069 iterator->OnURL(info.url()); |
1069 } | 1070 } |
1070 iterator->OnComplete(true); // Success. | 1071 iterator->OnComplete(true); // Success. |
1071 return; | 1072 return; |
1072 } | 1073 } |
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3042 info.url_id = visit.url_id; | 3043 info.url_id = visit.url_id; |
3043 info.time = visit.visit_time; | 3044 info.time = visit.visit_time; |
3044 info.transition = visit.transition; | 3045 info.transition = visit.transition; |
3045 // If we don't have a delegate yet during setup or shutdown, we will drop | 3046 // If we don't have a delegate yet during setup or shutdown, we will drop |
3046 // these notifications. | 3047 // these notifications. |
3047 if (delegate_.get()) | 3048 if (delegate_.get()) |
3048 delegate_->NotifyVisitDBObserversOnAddVisit(info); | 3049 delegate_->NotifyVisitDBObserversOnAddVisit(info); |
3049 } | 3050 } |
3050 | 3051 |
3051 } // namespace history | 3052 } // namespace history |
OLD | NEW |