OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // message loop. | 231 // message loop. |
232 void QuitCallback(TopSitesBackend::Handle handle) { | 232 void QuitCallback(TopSitesBackend::Handle handle) { |
233 MessageLoop::current()->Quit(); | 233 MessageLoop::current()->Quit(); |
234 } | 234 } |
235 | 235 |
236 // Adds a page to history. | 236 // Adds a page to history. |
237 void AddPageToHistory(const GURL& url) { | 237 void AddPageToHistory(const GURL& url) { |
238 RedirectList redirects; | 238 RedirectList redirects; |
239 redirects.push_back(url); | 239 redirects.push_back(url); |
240 history_service()->AddPage( | 240 history_service()->AddPage( |
241 url, static_cast<void*>(this), 0, GURL(), PageTransition::TYPED, | 241 url, static_cast<void*>(this), 0, GURL(), |
| 242 content::PAGE_TRANSITION_TYPED, |
242 redirects, history::SOURCE_BROWSED, false); | 243 redirects, history::SOURCE_BROWSED, false); |
243 } | 244 } |
244 | 245 |
245 // Adds a page to history. | 246 // Adds a page to history. |
246 void AddPageToHistory(const GURL& url, const string16& title) { | 247 void AddPageToHistory(const GURL& url, const string16& title) { |
247 RedirectList redirects; | 248 RedirectList redirects; |
248 redirects.push_back(url); | 249 redirects.push_back(url); |
249 history_service()->AddPage( | 250 history_service()->AddPage( |
250 url, static_cast<void*>(this), 0, GURL(), PageTransition::TYPED, | 251 url, static_cast<void*>(this), 0, GURL(), |
| 252 content::PAGE_TRANSITION_TYPED, |
251 redirects, history::SOURCE_BROWSED, false); | 253 redirects, history::SOURCE_BROWSED, false); |
252 history_service()->SetPageTitle(url, title); | 254 history_service()->SetPageTitle(url, title); |
253 } | 255 } |
254 | 256 |
255 // Adds a page to history. | 257 // Adds a page to history. |
256 void AddPageToHistory(const GURL& url, | 258 void AddPageToHistory(const GURL& url, |
257 const string16& title, | 259 const string16& title, |
258 const history::RedirectList& redirects, | 260 const history::RedirectList& redirects, |
259 base::Time time) { | 261 base::Time time) { |
260 history_service()->AddPage( | 262 history_service()->AddPage( |
261 url, time, static_cast<void*>(this), 0, GURL(), PageTransition::TYPED, | 263 url, time, static_cast<void*>(this), 0, GURL(), |
| 264 content::PAGE_TRANSITION_TYPED, |
262 redirects, history::SOURCE_BROWSED, false); | 265 redirects, history::SOURCE_BROWSED, false); |
263 history_service()->SetPageTitle(url, title); | 266 history_service()->SetPageTitle(url, title); |
264 } | 267 } |
265 | 268 |
266 // Delets a url. | 269 // Delets a url. |
267 void DeleteURL(const GURL& url) { | 270 void DeleteURL(const GURL& url) { |
268 history_service()->DeleteURL(url); | 271 history_service()->DeleteURL(url); |
269 } | 272 } |
270 | 273 |
271 // Returns true if the thumbnail equals the specified bytes. | 274 // Returns true if the thumbnail equals the specified bytes. |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 ui_test_utils::WindowedNotificationObserver observer( | 1388 ui_test_utils::WindowedNotificationObserver observer( |
1386 chrome::NOTIFICATION_TOP_SITES_LOADED, | 1389 chrome::NOTIFICATION_TOP_SITES_LOADED, |
1387 Source<Profile>(profile())); | 1390 Source<Profile>(profile())); |
1388 profile()->CreateTopSites(); | 1391 profile()->CreateTopSites(); |
1389 profile()->GetHistoryService(Profile::EXPLICIT_ACCESS)->UnloadBackend(); | 1392 profile()->GetHistoryService(Profile::EXPLICIT_ACCESS)->UnloadBackend(); |
1390 profile()->BlockUntilHistoryProcessesPendingRequests(); | 1393 profile()->BlockUntilHistoryProcessesPendingRequests(); |
1391 observer.Wait(); | 1394 observer.Wait(); |
1392 } | 1395 } |
1393 | 1396 |
1394 } // namespace history | 1397 } // namespace history |
OLD | NEW |