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

Unified Diff: chrome/browser/offline_pages/offline_page_mhtml_archiver.h

Issue 1236403003: [Offline pages] Moving browser code to android path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Narrowing the move to archiver only due to another patch moving the rest ot components Created 5 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: chrome/browser/offline_pages/offline_page_mhtml_archiver.h
diff --git a/chrome/browser/offline_pages/offline_page_mhtml_archiver.h b/chrome/browser/offline_pages/offline_page_mhtml_archiver.h
deleted file mode 100644
index 936b8afbf1da1ff7bffcfc9f7d1c6143e096bcdd..0000000000000000000000000000000000000000
--- a/chrome/browser/offline_pages/offline_page_mhtml_archiver.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// 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 CHROME_BROWSER_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_
-#define CHROME_BROWSER_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_
-
-#include <map>
-
-#include "base/callback.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
-#include "components/offline_pages/offline_page_archiver.h"
-
-namespace base {
-class FilePath;
-class SingleThreadTaskRunner;
-} // namespace base
-
-namespace content {
-class WebContents;
-} // namespace content
-
-namespace offline_pages {
-class TestMHTMLArchiver;
-
-// Class implementing an offline page archiver using MHTML as an archive format.
-//
-// To generate an MHTML archiver for a given URL, a WebContents instance should
-// have that URL loaded.
-//
-// Example:
-// void SavePageOffline(content::WebContents* web_contents) {
-// const GURL& url = web_contents->GetLastCommittedURL();
-// scoped_ptr<OfflinePageMHTMLArchiver> archiver(
-// new OfflinePageMHTMLArchiver(
-// web_contents, archiver_dir, task_runner));
-// // Callback is of type OfflinePageModel::SavePageCallback.
-// model->SavePage(url, archiver.Pass(), callback);
-// }
-class OfflinePageMHTMLArchiver : public OfflinePageArchiver {
- public:
- OfflinePageMHTMLArchiver(
- content::WebContents* web_contents,
- const base::FilePath& file_path,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
- ~OfflinePageMHTMLArchiver() override;
-
- // OfflinePageArchiver implementation:
- void CreateArchive(const CreateArchiveCallback& callback) override;
-
- private:
- friend class offline_pages::TestMHTMLArchiver;
-
- // Allows to overload the archiver for testing.
- OfflinePageMHTMLArchiver(
- const base::FilePath& file_path,
- const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
-
- // Sends the result of archiving a page to the client that requested archive
- // creation.
- void ReportResult(ArchiverResult result,
- const GURL& url,
- const base::string16& title,
- int64 file_size);
- void ReportFailure(ArchiverResult result);
-
- // Checks that |web_contents_| is still valid.
- virtual bool IsWebContentsValid() const;
- // Actual call to generate MHTML.
- virtual void GenerateMHTML();
- // Callback for Generating MHTML.
- void OnGenerateMHTMLDone(const GURL& url,
- const base::string16& title,
- int64 file_size);
-
- // Path to the archive file.
- const base::FilePath file_path_;
- // Contents of the web page to be serialized. Not owned.
- // TODO(fgorski): Add WebContentsObserver to know when the page navigates away
- // or shuts down.
- content::WebContents* web_contents_;
-
- CreateArchiveCallback callback_;
-
- // Task runner, which will be used to post the callback.
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
-
- base::WeakPtrFactory<OfflinePageMHTMLArchiver> weak_ptr_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(OfflinePageMHTMLArchiver);
-};
-
-} // namespace offline_pages
-
-#endif // CHROME_BROWSER_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_

Powered by Google App Engine
This is Rietveld 408576698