Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Unified Diff: components/sync_sessions/revisit/typed_url_page_revisit_observer.cc

Issue 1399053004: [Sync] Adding revisit logic for typed URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated for Stan's comments. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync_sessions/revisit/typed_url_page_revisit_observer.cc
diff --git a/components/sync_sessions/revisit/typed_url_page_revisit_observer.cc b/components/sync_sessions/revisit/typed_url_page_revisit_observer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..159189577cee28a3691d82e8d9e7c03e44d4067c
--- /dev/null
+++ b/components/sync_sessions/revisit/typed_url_page_revisit_observer.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync_sessions/revisit/typed_url_page_revisit_observer.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "components/history/core/browser/history_service.h"
+#include "components/sync_sessions/revisit/typed_url_page_revisit_task.h"
+#include "url/gurl.h"
+
+namespace sync_sessions {
+
+TypedUrlPageRevisitObserver::TypedUrlPageRevisitObserver(
+ history::HistoryService* history)
+ : history_(base::AsWeakPtr(history)) {}
+
+TypedUrlPageRevisitObserver::~TypedUrlPageRevisitObserver() {}
+
+void TypedUrlPageRevisitObserver::OnPageVisit(
+ const GURL& url,
+ const PageVisitObserver::TransitionType transition) {
+ if (history_) {
+ history_->ScheduleDBTask(scoped_ptr<history::HistoryDBTask>(
+ new TypedUrlPageRevisitTask(url, transition)),
+ &task_tracker_);
+ }
+}
+
+} // namespace sync_sessions

Powered by Google App Engine
This is Rietveld 408576698