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

Unified Diff: components/offline_pages/downloads/download_ui_adapter.h

Issue 2180973002: [Offline pages] Adapting OfflinePageDownloadBridge to DownloadUIAdapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui-adapter
Patch Set: Minor updates Created 4 years, 5 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/offline_pages/downloads/download_ui_adapter.h
diff --git a/components/offline_pages/downloads/download_ui_adapter.h b/components/offline_pages/downloads/download_ui_adapter.h
index 9363a946bff488b015186cfcca5e04e467a1cf0b..d96f11d7da757836ac0aee7a2cfc360b2a58b5e3 100644
--- a/components/offline_pages/downloads/download_ui_adapter.h
+++ b/components/offline_pages/downloads/download_ui_adapter.h
@@ -10,6 +10,7 @@
#include <string>
#include "base/observer_list.h"
+#include "base/supports_user_data.h"
#include "components/offline_pages/downloads/download_ui_item.h"
#include "components/offline_pages/offline_page_model.h"
#include "components/offline_pages/offline_page_types.h"
@@ -26,7 +27,8 @@ typedef
// UI components if needed. It manages the cache of DownloadUIItems, so after
// initial load the UI components can synchronously pull the whoel list or any
// item by its guid.
-class DownloadUIAdapter : public OfflinePageModel::Observer {
+class DownloadUIAdapter : public OfflinePageModel::Observer,
+ public base::SupportsUserData::Data {
public:
// Observer, normally implemented by UI or a Bridge.
class Observer {
@@ -54,6 +56,9 @@ class DownloadUIAdapter : public OfflinePageModel::Observer {
explicit DownloadUIAdapter(OfflinePageModel* model);
~DownloadUIAdapter() override;
+ static DownloadUIAdapter* FromOfflinePageModel(
+ OfflinePageModel* offline_page_model);
+
// This adapter is potentially shared by UI elements, each of which adds
// itself as an observer.
// When the last observer si removed, cached list of items is destroyed and
@@ -99,4 +104,4 @@ class DownloadUIAdapter : public OfflinePageModel::Observer {
} // namespace offline_pages
-#endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_
+#endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698