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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 // Get the ID for this URL. | 1044 // Get the ID for this URL. |
1045 URLRow row; | 1045 URLRow row; |
1046 if (!db_->GetRowForURL(url, &row)) { | 1046 if (!db_->GetRowForURL(url, &row)) { |
1047 // There is a small possibility the url was deleted before the keyword | 1047 // There is a small possibility the url was deleted before the keyword |
1048 // was added. Ignore the request. | 1048 // was added. Ignore the request. |
1049 return; | 1049 return; |
1050 } | 1050 } |
1051 | 1051 |
1052 db_->SetKeywordSearchTermsForURL(row.id(), keyword_id, term); | 1052 db_->SetKeywordSearchTermsForURL(row.id(), keyword_id, term); |
1053 | 1053 |
1054 BroadcastNotifications( | 1054 if (delegate_) |
1055 chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_UPDATED, | 1055 delegate_->NotifyKeywordSearchTermUpdated(row, keyword_id, term); |
1056 scoped_ptr<HistoryDetails>( | 1056 |
1057 new KeywordSearchUpdatedDetails(row, keyword_id, term))); | |
1058 ScheduleCommit(); | 1057 ScheduleCommit(); |
1059 } | 1058 } |
1060 | 1059 |
1061 void HistoryBackend::DeleteAllSearchTermsForKeyword(KeywordID keyword_id) { | 1060 void HistoryBackend::DeleteAllSearchTermsForKeyword(KeywordID keyword_id) { |
1062 if (!db_) | 1061 if (!db_) |
1063 return; | 1062 return; |
1064 | 1063 |
1065 db_->DeleteAllSearchTermsForKeyword(keyword_id); | 1064 db_->DeleteAllSearchTermsForKeyword(keyword_id); |
1066 ScheduleCommit(); | 1065 ScheduleCommit(); |
1067 } | 1066 } |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2690 info.url_id = visit.url_id; | 2689 info.url_id = visit.url_id; |
2691 info.time = visit.visit_time; | 2690 info.time = visit.visit_time; |
2692 info.transition = visit.transition; | 2691 info.transition = visit.transition; |
2693 // If we don't have a delegate yet during setup or shutdown, we will drop | 2692 // If we don't have a delegate yet during setup or shutdown, we will drop |
2694 // these notifications. | 2693 // these notifications. |
2695 if (delegate_) | 2694 if (delegate_) |
2696 delegate_->NotifyAddVisit(info); | 2695 delegate_->NotifyAddVisit(info); |
2697 } | 2696 } |
2698 | 2697 |
2699 } // namespace history | 2698 } // namespace history |
OLD | NEW |