| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/sync_sessions/revisit/typed_url_page_revisit_observer.h" | 5 #include "components/sync_sessions/revisit/typed_url_page_revisit_observer.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/history/core/browser/history_service.h" | 8 #include "components/history/core/browser/history_service.h" |
| 9 #include "components/sync_sessions/revisit/typed_url_page_revisit_task.h" | 9 #include "components/sync_sessions/revisit/typed_url_page_revisit_task.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace sync_sessions { | 12 namespace sync_sessions { |
| 13 | 13 |
| 14 TypedUrlPageRevisitObserver::TypedUrlPageRevisitObserver( | 14 TypedUrlPageRevisitObserver::TypedUrlPageRevisitObserver( |
| 15 history::HistoryService* history) | 15 history::HistoryService* history) |
| 16 : history_(base::AsWeakPtr(history)) {} | 16 : history_(base::AsWeakPtr(history)) {} |
| 17 | 17 |
| 18 TypedUrlPageRevisitObserver::~TypedUrlPageRevisitObserver() {} | 18 TypedUrlPageRevisitObserver::~TypedUrlPageRevisitObserver() {} |
| 19 | 19 |
| 20 void TypedUrlPageRevisitObserver::OnPageVisit( | 20 void TypedUrlPageRevisitObserver::OnPageVisit( |
| 21 const GURL& url, | 21 const GURL& url, |
| 22 const PageVisitObserver::TransitionType transition) { | 22 const PageVisitObserver::TransitionType transition) { |
| 23 if (history_) { | 23 if (history_) { |
| 24 history_->ScheduleDBTask( | 24 history_->ScheduleDBTask( |
| 25 base::WrapUnique(new TypedUrlPageRevisitTask(url, transition)), | 25 base::MakeUnique<TypedUrlPageRevisitTask>(url, transition), |
| 26 &task_tracker_); | 26 &task_tracker_); |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 } // namespace sync_sessions | 30 } // namespace sync_sessions |
| OLD | NEW |