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 // The history system runs on a background thread so that potentially slow | 5 // The history system runs on a background thread so that potentially slow |
6 // database operations don't delay the browser. This backend processing is | 6 // database operations don't delay the browser. This backend processing is |
7 // represented by HistoryBackend. The HistoryService's job is to dispatch to | 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to |
8 // that thread. | 8 // that thread. |
9 // | 9 // |
10 // Main thread History thread | 10 // Main thread History thread |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 void NotifyURLsModified(const history::URLRows& changed_urls) override { | 184 void NotifyURLsModified(const history::URLRows& changed_urls) override { |
185 service_task_runner_->PostTask( | 185 service_task_runner_->PostTask( |
186 FROM_HERE, | 186 FROM_HERE, |
187 base::Bind(&HistoryService::NotifyURLsModified, | 187 base::Bind(&HistoryService::NotifyURLsModified, |
188 history_service_, | 188 history_service_, |
189 changed_urls)); | 189 changed_urls)); |
190 } | 190 } |
191 | 191 |
| 192 void NotifyKeywordSearchTermUpdated(const history::URLRow& row, |
| 193 KeywordID keyword_id, |
| 194 const base::string16& term) override { |
| 195 service_task_runner_->PostTask( |
| 196 FROM_HERE, base::Bind(&HistoryService::NotifyKeywordSearchTermUpdated, |
| 197 history_service_, row, keyword_id, term)); |
| 198 } |
| 199 |
192 void BroadcastNotifications( | 200 void BroadcastNotifications( |
193 int type, | 201 int type, |
194 scoped_ptr<history::HistoryDetails> details) override { | 202 scoped_ptr<history::HistoryDetails> details) override { |
195 // Send the notification on the history thread. | 203 // Send the notification on the history thread. |
196 if (content::NotificationService::current()) { | 204 if (content::NotificationService::current()) { |
197 content::Details<history::HistoryDetails> det(details.get()); | 205 content::Details<history::HistoryDetails> det(details.get()); |
198 content::NotificationService::current()->Notify( | 206 content::NotificationService::current()->Notify( |
199 type, content::Source<Profile>(profile_), det); | 207 type, content::Source<Profile>(profile_), det); |
200 } | 208 } |
201 // Send the notification to the history service on the main thread. | 209 // Send the notification to the history service on the main thread. |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, | 1281 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
1274 OnHistoryServiceLoaded(this)); | 1282 OnHistoryServiceLoaded(this)); |
1275 } | 1283 } |
1276 | 1284 |
1277 void HistoryService::NotifyHistoryServiceBeingDeleted() { | 1285 void HistoryService::NotifyHistoryServiceBeingDeleted() { |
1278 DCHECK(thread_checker_.CalledOnValidThread()); | 1286 DCHECK(thread_checker_.CalledOnValidThread()); |
1279 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, | 1287 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
1280 HistoryServiceBeingDeleted(this)); | 1288 HistoryServiceBeingDeleted(this)); |
1281 } | 1289 } |
1282 | 1290 |
| 1291 void HistoryService::NotifyKeywordSearchTermUpdated( |
| 1292 const history::URLRow& row, |
| 1293 history::KeywordID keyword_id, |
| 1294 const base::string16& term) { |
| 1295 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1296 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
| 1297 OnKeywordSearchTermUpdated(this, row, keyword_id, term)); |
| 1298 } |
| 1299 |
1283 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> | 1300 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> |
1284 HistoryService::AddFaviconChangedCallback( | 1301 HistoryService::AddFaviconChangedCallback( |
1285 const HistoryService::OnFaviconChangedCallback& callback) { | 1302 const HistoryService::OnFaviconChangedCallback& callback) { |
1286 DCHECK(thread_checker_.CalledOnValidThread()); | 1303 DCHECK(thread_checker_.CalledOnValidThread()); |
1287 return favicon_changed_callback_list_.Add(callback); | 1304 return favicon_changed_callback_list_.Add(callback); |
1288 } | 1305 } |
1289 | 1306 |
1290 void HistoryService::NotifyFaviconChanged( | 1307 void HistoryService::NotifyFaviconChanged( |
1291 const std::set<GURL>& changed_favicons) { | 1308 const std::set<GURL>& changed_favicons) { |
1292 DCHECK(thread_checker_.CalledOnValidThread()); | 1309 DCHECK(thread_checker_.CalledOnValidThread()); |
1293 favicon_changed_callback_list_.Notify(changed_favicons); | 1310 favicon_changed_callback_list_.Notify(changed_favicons); |
1294 } | 1311 } |
OLD | NEW |