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