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

Side by Side Diff: components/offline_pages/request_header/offline_page_header.h

Issue 2362033002: Showing previews UI for Offline Previews (Closed)
Patch Set: megjablon comments rebase Created 4 years, 2 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_PAGES_REQUEST_HEADER_OFFLINE_PAGE_HEADER_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_REQUEST_HEADER_OFFLINE_PAGE_HEADER_H_
6 #define COMPONENTS_OFFLINE_PAGES_REQUEST_HEADER_OFFLINE_PAGE_HEADER_H_ 6 #define COMPONENTS_OFFLINE_PAGES_REQUEST_HEADER_OFFLINE_PAGE_HEADER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace offline_pages { 10 namespace offline_pages {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 DOWNLOAD, 47 DOWNLOAD,
48 RELOAD 48 RELOAD
49 }; 49 };
50 50
51 OfflinePageHeader(); 51 OfflinePageHeader();
52 52
53 // Constructed from a request header value string. 53 // Constructed from a request header value string.
54 // The struct members will be cleared if the parsing failed. 54 // The struct members will be cleared if the parsing failed.
55 explicit OfflinePageHeader(const std::string& header_value); 55 explicit OfflinePageHeader(const std::string& header_value);
56 56
57 // Creates a copy of |other|.
58 OfflinePageHeader(const OfflinePageHeader& other);
59
57 ~OfflinePageHeader(); 60 ~OfflinePageHeader();
58 61
59 // Returns the full header string, including both key and value, that could be 62 // Returns the full header string, including both key and value, that could be
60 // passed to set extra request header. 63 // passed to set extra request header.
61 std::string GetCompleteHeaderString() const; 64 std::string GetCompleteHeaderString() const;
62 65
63 void Clear(); 66 void Clear();
64 67
65 // Set if failed to parse a request header value string. For testing only. 68 // Set if failed to parse a request header value string. For testing only.
66 bool did_fail_parsing_for_test; 69 bool did_fail_parsing_for_test;
67 70
68 // Flag to indicate if the header should be persisted across session restore. 71 // Flag to indicate if the header should be persisted across session restore.
69 bool need_to_persist; 72 bool need_to_persist;
70 73
71 // Describes the reason to load offline page. 74 // Describes the reason to load offline page.
72 Reason reason; 75 Reason reason;
73 76
74 // The offline ID of the page to load. 77 // The offline ID of the page to load.
75 std::string id; 78 std::string id;
76 }; 79 };
77 80
78 } // namespace offline_pages 81 } // namespace offline_pages
79 82
80 #endif // COMPONENTS_OFFLINE_PAGES_REQUEST_HEADER_OFFLINE_PAGE_HEADER_H_ 83 #endif // COMPONENTS_OFFLINE_PAGES_REQUEST_HEADER_OFFLINE_PAGE_HEADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698