Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: chrome/browser/history/history_service.cc

Issue 830483005: Eliminate sending NOTIFICATION_HISTORY_KEYWORD_SEARCH_TERM_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 void NotifyKeywordSearchTermUpdated(const history::URLRow& row, 192 void NotifyKeywordSearchTermUpdated(const history::URLRow& row,
193 KeywordID keyword_id, 193 KeywordID keyword_id,
194 const base::string16& term) override { 194 const base::string16& term) override {
195 service_task_runner_->PostTask( 195 service_task_runner_->PostTask(
196 FROM_HERE, base::Bind(&HistoryService::NotifyKeywordSearchTermUpdated, 196 FROM_HERE, base::Bind(&HistoryService::NotifyKeywordSearchTermUpdated,
197 history_service_, row, keyword_id, term)); 197 history_service_, row, keyword_id, term));
198 } 198 }
199 199
200 void NotifyKeywordSearchTermDeleted(history::URLID url_id) override {
201 service_task_runner_->PostTask(
202 FROM_HERE, base::Bind(&HistoryService::NotifyKeywordSearchTermDeleted,
203 history_service_, url_id));
204 }
205
200 void BroadcastNotifications( 206 void BroadcastNotifications(
201 int type, 207 int type,
202 scoped_ptr<history::HistoryDetails> details) override { 208 scoped_ptr<history::HistoryDetails> details) override {
203 // Send the notification on the history thread. 209 // Send the notification on the history thread.
204 if (content::NotificationService::current()) { 210 if (content::NotificationService::current()) {
205 content::Details<history::HistoryDetails> det(details.get()); 211 content::Details<history::HistoryDetails> det(details.get());
206 content::NotificationService::current()->Notify( 212 content::NotificationService::current()->Notify(
207 type, content::Source<Profile>(profile_), det); 213 type, content::Source<Profile>(profile_), det);
208 } 214 }
209 // Send the notification to the history service on the main thread. 215 // Send the notification to the history service on the main thread.
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 1296
1291 void HistoryService::NotifyKeywordSearchTermUpdated( 1297 void HistoryService::NotifyKeywordSearchTermUpdated(
1292 const history::URLRow& row, 1298 const history::URLRow& row,
1293 history::KeywordID keyword_id, 1299 history::KeywordID keyword_id,
1294 const base::string16& term) { 1300 const base::string16& term) {
1295 DCHECK(thread_checker_.CalledOnValidThread()); 1301 DCHECK(thread_checker_.CalledOnValidThread());
1296 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_, 1302 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_,
1297 OnKeywordSearchTermUpdated(this, row, keyword_id, term)); 1303 OnKeywordSearchTermUpdated(this, row, keyword_id, term));
1298 } 1304 }
1299 1305
1306 void HistoryService::NotifyKeywordSearchTermDeleted(history::URLID url_id) {
1307 DCHECK(thread_checker_.CalledOnValidThread());
1308 FOR_EACH_OBSERVER(history::HistoryServiceObserver, observers_,
1309 OnKeywordSearchTermDeleted(this, url_id));
1310 }
1311
1300 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> 1312 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
1301 HistoryService::AddFaviconChangedCallback( 1313 HistoryService::AddFaviconChangedCallback(
1302 const HistoryService::OnFaviconChangedCallback& callback) { 1314 const HistoryService::OnFaviconChangedCallback& callback) {
1303 DCHECK(thread_checker_.CalledOnValidThread()); 1315 DCHECK(thread_checker_.CalledOnValidThread());
1304 return favicon_changed_callback_list_.Add(callback); 1316 return favicon_changed_callback_list_.Add(callback);
1305 } 1317 }
1306 1318
1307 void HistoryService::NotifyFaviconChanged( 1319 void HistoryService::NotifyFaviconChanged(
1308 const std::set<GURL>& changed_favicons) { 1320 const std::set<GURL>& changed_favicons) {
1309 DCHECK(thread_checker_.CalledOnValidThread()); 1321 DCHECK(thread_checker_.CalledOnValidThread());
1310 favicon_changed_callback_list_.Notify(changed_favicons); 1322 favicon_changed_callback_list_.Notify(changed_favicons);
1311 } 1323 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | chrome/browser/history/history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698