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

Unified Diff: chrome/browser/android/offline_pages/request_coordinator_factory.cc

Issue 2260963003: [Offline pages] Enabling notifications for pages saved later (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing missed TODO Created 4 years, 4 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: chrome/browser/android/offline_pages/request_coordinator_factory.cc
diff --git a/chrome/browser/android/offline_pages/request_coordinator_factory.cc b/chrome/browser/android/offline_pages/request_coordinator_factory.cc
index 060b42b5b6d779b899e0549108579fb8c16801ef..f453dd2c1fe01b9121165cb27478f90f439c110a 100644
--- a/chrome/browser/android/offline_pages/request_coordinator_factory.cc
+++ b/chrome/browser/android/offline_pages/request_coordinator_factory.cc
@@ -6,9 +6,11 @@
#include <memory>
+#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "base/sequenced_task_runner.h"
#include "chrome/browser/android/offline_pages/background_scheduler_bridge.h"
+#include "chrome/browser/android/offline_pages/downloads/offline_page_notification_bridge.h"
#include "chrome/browser/android/offline_pages/prerendering_offliner_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_constants.h"
@@ -20,6 +22,7 @@
#include "components/offline_pages/background/request_queue_store.h"
#include "components/offline_pages/background/request_queue_store_sql.h"
#include "components/offline_pages/background/scheduler.h"
+#include "components/offline_pages/downloads/download_notifying_observer.h"
#include "content/public/browser/browser_thread.h"
namespace offline_pages {
@@ -59,11 +62,17 @@ KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor(
std::unique_ptr<RequestQueue> queue(new RequestQueue(std::move(queue_store)));
std::unique_ptr<Scheduler>
scheduler(new android::BackgroundSchedulerBridge());
+ // TODO(fgorski): Something needs to keep the handle to the Notification
+ // dispatcher.
+ RequestCoordinator* request_coordinator =
+ new RequestCoordinator(std::move(policy), std::move(prerenderer_offliner),
+ std::move(queue), std::move(scheduler));
- return new RequestCoordinator(std::move(policy),
- std::move(prerenderer_offliner),
- std::move(queue),
- std::move(scheduler));
+ DownloadNotifyingObserver::CreateAndStartObserving(
+ request_coordinator,
+ base::MakeUnique<android::OfflinePageNotificationBridge>());
+
+ return request_coordinator;
}
content::BrowserContext* RequestCoordinatorFactory::GetBrowserContextToUse(

Powered by Google App Engine
This is Rietveld 408576698