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

Side by Side Diff: components/offline_pages/downloads/download_ui_adapter.h

Issue 2340133005: Merge M54: Support serving offline page by offline ID (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_
6 #define COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ 6 #define COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 // Returns all UI items. The list contains references to items in the cache 70 // Returns all UI items. The list contains references to items in the cache
71 // and has to be used synchronously. 71 // and has to be used synchronously.
72 std::vector<const DownloadUIItem*> GetAllItems() const; 72 std::vector<const DownloadUIItem*> GetAllItems() const;
73 // May return nullptr if item with specified guid does not exist. 73 // May return nullptr if item with specified guid does not exist.
74 const DownloadUIItem* GetItem(const std::string& guid) const; 74 const DownloadUIItem* GetItem(const std::string& guid) const;
75 75
76 // Commands from UI. Start async operations, result is observable 76 // Commands from UI. Start async operations, result is observable
77 // via Observer or directly by the user (as in 'open'). 77 // via Observer or directly by the user (as in 'open').
78 void DeleteItem(const std::string& guid); 78 void DeleteItem(const std::string& guid);
79 GURL GetOfflineUrlByGuid(const std::string& guid) const; 79 int64_t GetOfflineIdByGuid(const std::string& guid) const;
80 80
81 // OfflinePageModel::Observer 81 // OfflinePageModel::Observer
82 void OfflinePageModelLoaded(OfflinePageModel* model) override; 82 void OfflinePageModelLoaded(OfflinePageModel* model) override;
83 void OfflinePageModelChanged(OfflinePageModel* model) override; 83 void OfflinePageModelChanged(OfflinePageModel* model) override;
84 void OfflinePageDeleted(int64_t offline_id, 84 void OfflinePageDeleted(int64_t offline_id,
85 const ClientId& client_id) override; 85 const ClientId& client_id) override;
86 86
87 private: 87 private:
88 enum class State { 88 enum class State {
89 NOT_LOADED, 89 NOT_LOADED,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 int observers_count_; 128 int observers_count_;
129 129
130 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_; 130 base::WeakPtrFactory<DownloadUIAdapter> weak_ptr_factory_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter); 132 DISALLOW_COPY_AND_ASSIGN(DownloadUIAdapter);
133 }; 133 };
134 134
135 } // namespace offline_pages 135 } // namespace offline_pages
136 136
137 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_ 137 #endif // COMPONENTS_OFFLINE_PAGE_DOWNLOADS_DOWNLOAD_UI_ADAPTER_H_
OLDNEW
« no previous file with comments | « chrome/test/data/offline_pages/hello.mhtml ('k') | components/offline_pages/downloads/download_ui_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698