| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 virtual bool RunOnDBThread(HistoryBackend* backend, HistoryDatabase* db) { | 52 virtual bool RunOnDBThread(HistoryBackend* backend, HistoryDatabase* db) { |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual void DoneRunOnMainThread() { | 56 virtual void DoneRunOnMainThread() { |
| 57 MessageLoop::current()->Quit(); | 57 MessageLoop::current()->Quit(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 virtual ~WaitForHistoryTask() {} |
| 62 |
| 61 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); | 63 DISALLOW_COPY_AND_ASSIGN(WaitForHistoryTask); |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 // Used for querying top sites. Either runs sequentially, or runs a nested | 66 // Used for querying top sites. Either runs sequentially, or runs a nested |
| 65 // nested message loop until the response is complete. The later is used when | 67 // nested message loop until the response is complete. The later is used when |
| 66 // TopSites is queried before it finishes loading. | 68 // TopSites is queried before it finishes loading. |
| 67 class TopSitesQuerier { | 69 class TopSitesQuerier { |
| 68 public: | 70 public: |
| 69 TopSitesQuerier() : number_of_callbacks_(0), waiting_(false) {} | 71 TopSitesQuerier() : number_of_callbacks_(0), waiting_(false) {} |
| 70 | 72 |
| (...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 ui_test_utils::WindowedNotificationObserver observer( | 1236 ui_test_utils::WindowedNotificationObserver observer( |
| 1235 chrome::NOTIFICATION_TOP_SITES_LOADED, | 1237 chrome::NOTIFICATION_TOP_SITES_LOADED, |
| 1236 content::Source<Profile>(profile())); | 1238 content::Source<Profile>(profile())); |
| 1237 profile()->CreateTopSites(); | 1239 profile()->CreateTopSites(); |
| 1238 profile()->GetHistoryService(Profile::EXPLICIT_ACCESS)->UnloadBackend(); | 1240 profile()->GetHistoryService(Profile::EXPLICIT_ACCESS)->UnloadBackend(); |
| 1239 profile()->BlockUntilHistoryProcessesPendingRequests(); | 1241 profile()->BlockUntilHistoryProcessesPendingRequests(); |
| 1240 observer.Wait(); | 1242 observer.Wait(); |
| 1241 } | 1243 } |
| 1242 | 1244 |
| 1243 } // namespace history | 1245 } // namespace history |
| OLD | NEW |