| 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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1067 | 1067 | 
| 1068 void HistoryBackend::DeleteKeywordSearchTermForURL(const GURL& url) { | 1068 void HistoryBackend::DeleteKeywordSearchTermForURL(const GURL& url) { | 
| 1069   if (!db_) | 1069   if (!db_) | 
| 1070     return; | 1070     return; | 
| 1071 | 1071 | 
| 1072   URLID url_id = db_->GetRowForURL(url, NULL); | 1072   URLID url_id = db_->GetRowForURL(url, NULL); | 
| 1073   if (!url_id) | 1073   if (!url_id) | 
| 1074     return; | 1074     return; | 
| 1075   db_->DeleteKeywordSearchTermForURL(url_id); | 1075   db_->DeleteKeywordSearchTermForURL(url_id); | 
| 1076 | 1076 | 
| 1077   BroadcastNotifications( | 1077   if (delegate_) | 
| 1078       chrome::NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED, | 1078     delegate_->NotifyKeywordSearchTermDeleted(url_id); | 
| 1079       scoped_ptr<HistoryDetails>(new KeywordSearchDeletedDetails(url_id))); | 1079 | 
| 1080   ScheduleCommit(); | 1080   ScheduleCommit(); | 
| 1081 } | 1081 } | 
| 1082 | 1082 | 
| 1083 void HistoryBackend::DeleteMatchingURLsForKeyword(KeywordID keyword_id, | 1083 void HistoryBackend::DeleteMatchingURLsForKeyword(KeywordID keyword_id, | 
| 1084                                                   const base::string16& term) { | 1084                                                   const base::string16& term) { | 
| 1085   if (!db_) | 1085   if (!db_) | 
| 1086     return; | 1086     return; | 
| 1087 | 1087 | 
| 1088   std::vector<KeywordSearchTermRow> rows; | 1088   std::vector<KeywordSearchTermRow> rows; | 
| 1089   if (db_->GetKeywordSearchTermRows(term, &rows)) { | 1089   if (db_->GetKeywordSearchTermRows(term, &rows)) { | 
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2689   info.url_id = visit.url_id; | 2689   info.url_id = visit.url_id; | 
| 2690   info.time = visit.visit_time; | 2690   info.time = visit.visit_time; | 
| 2691   info.transition = visit.transition; | 2691   info.transition = visit.transition; | 
| 2692   // 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 | 
| 2693   // these notifications. | 2693   // these notifications. | 
| 2694   if (delegate_) | 2694   if (delegate_) | 
| 2695     delegate_->NotifyAddVisit(info); | 2695     delegate_->NotifyAddVisit(info); | 
| 2696 } | 2696 } | 
| 2697 | 2697 | 
| 2698 }  // namespace history | 2698 }  // namespace history | 
| OLD | NEW | 
|---|