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 "chrome/browser/history/android/android_history_provider_service.h" | 5 #include "chrome/browser/history/android/android_history_provider_service.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "chrome/browser/favicon/favicon_service_factory.h" | 9 #include "chrome/browser/favicon/favicon_service_factory.h" |
8 #include "chrome/browser/history/android/android_provider_backend.h" | 10 #include "chrome/browser/history/android/android_provider_backend.h" |
9 #include "chrome/browser/history/history_service_factory.h" | 11 #include "chrome/browser/history/history_service_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
11 #include "components/favicon/core/favicon_service.h" | 13 #include "components/favicon/core/favicon_service.h" |
12 #include "components/history/core/browser/android/android_history_types.h" | 14 #include "components/history/core/browser/android/android_history_types.h" |
13 #include "components/history/core/browser/history_backend.h" | 15 #include "components/history/core/browser/history_backend.h" |
14 #include "components/history/core/browser/history_db_task.h" | 16 #include "components/history/core/browser/history_db_task.h" |
15 #include "components/history/core/browser/history_service.h" | 17 #include "components/history/core/browser/history_service.h" |
16 | 18 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 void AndroidHistoryProviderService::CloseStatement( | 368 void AndroidHistoryProviderService::CloseStatement( |
367 history::AndroidStatement* statement) { | 369 history::AndroidStatement* statement) { |
368 history::HistoryService* hs = HistoryServiceFactory::GetForProfile( | 370 history::HistoryService* hs = HistoryServiceFactory::GetForProfile( |
369 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 371 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
370 if (!hs) { | 372 if (!hs) { |
371 delete statement; | 373 delete statement; |
372 return; | 374 return; |
373 } | 375 } |
374 scoped_ptr<CloseStatementTask> task(new CloseStatementTask(statement)); | 376 scoped_ptr<CloseStatementTask> task(new CloseStatementTask(statement)); |
375 base::CancelableTaskTracker* tracker = task->tracker(); | 377 base::CancelableTaskTracker* tracker = task->tracker(); |
376 hs->ScheduleDBTask(task.Pass(), tracker); | 378 hs->ScheduleDBTask(std::move(task), tracker); |
377 } | 379 } |
378 | 380 |
379 base::CancelableTaskTracker::TaskId | 381 base::CancelableTaskTracker::TaskId |
380 AndroidHistoryProviderService::InsertSearchTerm( | 382 AndroidHistoryProviderService::InsertSearchTerm( |
381 const history::SearchRow& row, | 383 const history::SearchRow& row, |
382 const InsertCallback& callback, | 384 const InsertCallback& callback, |
383 base::CancelableTaskTracker* tracker) { | 385 base::CancelableTaskTracker* tracker) { |
384 history::HistoryService* hs = HistoryServiceFactory::GetForProfile( | 386 history::HistoryService* hs = HistoryServiceFactory::GetForProfile( |
385 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 387 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
386 if (!hs) { | 388 if (!hs) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 base::CancelableTaskTracker::TaskId | 459 base::CancelableTaskTracker::TaskId |
458 AndroidHistoryProviderService::GetLargestRawFaviconForID( | 460 AndroidHistoryProviderService::GetLargestRawFaviconForID( |
459 favicon_base::FaviconID favicon_id, | 461 favicon_base::FaviconID favicon_id, |
460 const favicon_base::FaviconRawBitmapCallback& callback, | 462 const favicon_base::FaviconRawBitmapCallback& callback, |
461 base::CancelableTaskTracker* tracker) { | 463 base::CancelableTaskTracker* tracker) { |
462 favicon::FaviconService* fs = FaviconServiceFactory::GetForProfile( | 464 favicon::FaviconService* fs = FaviconServiceFactory::GetForProfile( |
463 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 465 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
464 DCHECK(fs); | 466 DCHECK(fs); |
465 return fs->GetLargestRawFaviconForID(favicon_id, callback, tracker); | 467 return fs->GetLargestRawFaviconForID(favicon_id, callback, tracker); |
466 } | 468 } |
OLD | NEW |