summaryrefslogtreecommitdiffstats
path: root/components/offline_pages/offline_page_model.h
diff options
context:
space:
mode:
authorfgorski <fgorski@chromium.org>2015-06-02 17:28:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-03 00:29:39 +0000
commitd0e3446c634964ac8ec0396df7ec1d25b3908740 (patch)
treefce382e63325a1237201f2db9fb7dc7e8835d687 /components/offline_pages/offline_page_model.h
parent3346ab66acfd8bc8321edd794f238e8cfc0e7f9c (diff)
downloadchromium_src-d0e3446c634964ac8ec0396df7ec1d25b3908740.zip
chromium_src-d0e3446c634964ac8ec0396df7ec1d25b3908740.tar.gz
chromium_src-d0e3446c634964ac8ec0396df7ec1d25b3908740.tar.bz2
Initial commit of offline pages.
* Creates OfflinePageModel (not implemented) and basic OfflinePageItem * Adds components/offline_pages with OWNERS and DEPS * Creates components/offline_pages.gypi * Includes offline pages across gyp files BUG=491352 Review URL: https://codereview.chromium.org/1147983005 Cr-Commit-Position: refs/heads/master@{#332508}
Diffstat (limited to 'components/offline_pages/offline_page_model.h')
-rw-r--r--components/offline_pages/offline_page_model.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
new file mode 100644
index 0000000..7e57a14
--- /dev/null
+++ b/components/offline_pages/offline_page_model.h
@@ -0,0 +1,41 @@
+// 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.
+
+#ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
+#define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "components/keyed_service/core/keyed_service.h"
+
+class GURL;
+
+namespace offline_pages {
+
+struct OfflinePageItem;
+
+// Serivce for saving pages offline, storing the offline copy and metadata, and
+// retrieving them upon request.
+class OfflinePageModel : public KeyedService {
+ public:
+ OfflinePageModel();
+ ~OfflinePageModel() override;
+
+ // KeyedService:
+ void Shutdown() override;
+
+ // Saves the page loaded in the web contents offline.
+ void SavePageOffline(const GURL& url);
+
+ // Gets a set of all offline pages metadata.
+ std::vector<OfflinePageItem> GetAllOfflinePages();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(OfflinePageModel);
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_H_