| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_history_client.h" | 5 #include "chrome/browser/history/chrome_history_client.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/history/history_notifications.h" | 9 #include "chrome/browser/history/history_notifications.h" |
| 10 #include "chrome/browser/history/top_sites.h" | 10 #include "chrome/browser/history/top_sites.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // (meaning if we invoked HistoryService::Cleanup now, we would deadlock). To | 76 // (meaning if we invoked HistoryService::Cleanup now, we would deadlock). To |
| 77 // break the deadlock we tell BookmarkModel it's about to be deleted so that | 77 // break the deadlock we tell BookmarkModel it's about to be deleted so that |
| 78 // it can release the signal history is waiting on, allowing history to | 78 // it can release the signal history is waiting on, allowing history to |
| 79 // shutdown (HistoryService::Cleanup to complete). In such a scenario history | 79 // shutdown (HistoryService::Cleanup to complete). In such a scenario history |
| 80 // sees an incorrect view of bookmarks, but it's better than a deadlock. | 80 // sees an incorrect view of bookmarks, but it's better than a deadlock. |
| 81 bookmark_model_->Shutdown(); | 81 bookmark_model_->Shutdown(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ChromeHistoryClient::TopSitesLoaded(history::TopSites* top_sites) { | 84 void ChromeHistoryClient::TopSitesLoaded(history::TopSites* top_sites) { |
| 85 content::NotificationService::current()->Notify( | 85 content::NotificationService::current()->Notify( |
| 86 chrome::NOTIFICATION_TOP_SITES_LOADED, | 86 chrome::NOTIFICATION_TOP_SITES_LOADED, content::Source<Profile>(profile_), |
| 87 content::Source<Profile>(profile_), | |
| 88 content::Details<history::TopSites>(top_sites)); | 87 content::Details<history::TopSites>(top_sites)); |
| 89 } | 88 } |
| 90 | 89 |
| 91 void ChromeHistoryClient::TopSitesChanged(history::TopSites* top_sites) { | 90 void ChromeHistoryClient::TopSitesChanged(history::TopSites* top_sites) { |
| 92 content::NotificationService::current()->Notify( | 91 content::NotificationService::current()->Notify( |
| 93 chrome::NOTIFICATION_TOP_SITES_CHANGED, | 92 chrome::NOTIFICATION_TOP_SITES_CHANGED, |
| 94 content::Source<history::TopSites>(top_sites), | 93 content::Source<history::TopSites>(top_sites), |
| 95 content::NotificationService::NoDetails()); | 94 content::NotificationService::NoDetails()); |
| 96 } | 95 } |
| OLD | NEW |