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 NotifyHistoryKeywordSearchTermUpdated( |
| 193 const history::URLRow& row, |
| 194 KeywordID keyword_id, |
| 195 const base::string16& term) override { |
| 196 service_task_runner_->PostTask( |
| 197 FROM_HERE, |
| 198 base::Bind(&HistoryService::NotifyHistoryKeywordSearchTermUpdated, |
| 199 history_service_, row, keyword_id, term)); |
| 200 } |
| 201 |
192 void BroadcastNotifications( | 202 void BroadcastNotifications( |
193 int type, | 203 int type, |
194 scoped_ptr<history::HistoryDetails> details) override { | 204 scoped_ptr<history::HistoryDetails> details) override { |
195 // Send the notification on the history thread. | 205 // Send the notification on the history thread. |
196 if (content::NotificationService::current()) { | 206 if (content::NotificationService::current()) { |
197 content::Details<history::HistoryDetails> det(details.get()); | 207 content::Details<history::HistoryDetails> det(details.get()); |
198 content::NotificationService::current()->Notify( | 208 content::NotificationService::current()->Notify( |
199 type, content::Source<Profile>(profile_), det); | 209 type, content::Source<Profile>(profile_), det); |
200 } | 210 } |
201 // Send the notification to the history service on the main thread. | 211 // 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_, | 1283 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
1274 OnHistoryServiceLoaded(this)); | 1284 OnHistoryServiceLoaded(this)); |
1275 } | 1285 } |
1276 | 1286 |
1277 void HistoryService::NotifyHistoryServiceBeingDeleted() { | 1287 void HistoryService::NotifyHistoryServiceBeingDeleted() { |
1278 DCHECK(thread_checker_.CalledOnValidThread()); | 1288 DCHECK(thread_checker_.CalledOnValidThread()); |
1279 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, | 1289 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, |
1280 HistoryServiceBeingDeleted(this)); | 1290 HistoryServiceBeingDeleted(this)); |
1281 } | 1291 } |
1282 | 1292 |
| 1293 void HistoryService::NotifyHistoryKeywordSearchTermUpdated( |
| 1294 const history::URLRow& row, |
| 1295 history::KeywordID keyword_id, |
| 1296 const base::string16& term) { |
| 1297 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1298 FOR_EACH_OBSERVER( |
| 1299 history::HistoryServiceObserver, observers_, |
| 1300 HistoryKeywordSearchTermUpdated(this, row, keyword_id, term)); |
| 1301 } |
| 1302 |
1283 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> | 1303 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> |
1284 HistoryService::AddFaviconChangedCallback( | 1304 HistoryService::AddFaviconChangedCallback( |
1285 const HistoryService::OnFaviconChangedCallback& callback) { | 1305 const HistoryService::OnFaviconChangedCallback& callback) { |
1286 DCHECK(thread_checker_.CalledOnValidThread()); | 1306 DCHECK(thread_checker_.CalledOnValidThread()); |
1287 return favicon_changed_callback_list_.Add(callback); | 1307 return favicon_changed_callback_list_.Add(callback); |
1288 } | 1308 } |
1289 | 1309 |
1290 void HistoryService::NotifyFaviconChanged( | 1310 void HistoryService::NotifyFaviconChanged( |
1291 const std::set<GURL>& changed_favicons) { | 1311 const std::set<GURL>& changed_favicons) { |
1292 DCHECK(thread_checker_.CalledOnValidThread()); | 1312 DCHECK(thread_checker_.CalledOnValidThread()); |
1293 favicon_changed_callback_list_.Notify(changed_favicons); | 1313 favicon_changed_callback_list_.Notify(changed_favicons); |
1294 } | 1314 } |
OLD | NEW |