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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_mhtml_archiver.h

Issue 2810913002: [Offline pages] Add new Error page failure status inside the MHTML archiver and update correspondin… (Closed)
Patch Set: add comments and fix tests Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_mhtml_archiver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_ 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "components/offline_pages/core/offline_page_archiver.h" 17 #include "components/offline_pages/core/offline_page_archiver.h"
18 #include "content/public/common/page_type.h"
18 19
19 namespace base { 20 namespace base {
20 class FilePath; 21 class FilePath;
21 } // namespace base 22 } // namespace base
22 23
23 namespace content { 24 namespace content {
24 class WebContents; 25 class WebContents;
25 } // namespace content 26 } // namespace content
26 27
27 namespace offline_pages { 28 namespace offline_pages {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void OnGenerateMHTMLDone(const GURL& url, 65 void OnGenerateMHTMLDone(const GURL& url,
65 const base::FilePath& file_path, 66 const base::FilePath& file_path,
66 const base::string16& title, 67 const base::string16& title,
67 int64_t file_size); 68 int64_t file_size);
68 69
69 // Checks whether the page to be saved has security error when loaded over 70 // Checks whether the page to be saved has security error when loaded over
70 // HTTPS. Saving a page will fail if that is the case. HTTP connections are 71 // HTTPS. Saving a page will fail if that is the case. HTTP connections are
71 // not affected. 72 // not affected.
72 virtual bool HasConnectionSecurityError(); 73 virtual bool HasConnectionSecurityError();
73 74
75 // Returns the page type of the page being saved.
76 virtual content::PageType GetPageType();
77
74 // Reports failure to create archive a page to the client that requested it. 78 // Reports failure to create archive a page to the client that requested it.
75 void ReportFailure(ArchiverResult result); 79 void ReportFailure(ArchiverResult result);
76 80
77 private: 81 private:
78 // Contents of the web page to be serialized. Not owned. 82 // Contents of the web page to be serialized. Not owned.
79 content::WebContents* web_contents_; 83 content::WebContents* web_contents_;
80 84
81 CreateArchiveCallback callback_; 85 CreateArchiveCallback callback_;
82 86
83 base::WeakPtrFactory<OfflinePageMHTMLArchiver> weak_ptr_factory_; 87 base::WeakPtrFactory<OfflinePageMHTMLArchiver> weak_ptr_factory_;
84 88
85 DISALLOW_COPY_AND_ASSIGN(OfflinePageMHTMLArchiver); 89 DISALLOW_COPY_AND_ASSIGN(OfflinePageMHTMLArchiver);
86 }; 90 };
87 91
88 } // namespace offline_pages 92 } // namespace offline_pages
89 93
90 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_ 94 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_MHTML_ARCHIVER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/offline_page_mhtml_archiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698