OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_COMMON_PAGE_STATE_H_ | |
6 #define CONTENT_PUBLIC_COMMON_PAGE_STATE_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "content/common/content_export.h" | |
12 | |
13 class GURL; | |
14 | |
15 namespace base { | |
16 class FilePath; | |
17 } | |
18 | |
19 namespace content { | |
20 | |
21 class CONTENT_EXPORT PageState { | |
22 public: | |
23 static PageState CreateFromEncodedData(const std::string& data); | |
24 static PageState CreateFromURL(const GURL& url); | |
25 | |
26 static PageState CreateForTesting( | |
27 const GURL& url, | |
28 bool body_contains_password_data, | |
29 const char* optional_body_data, | |
30 const base::FilePath* optional_body_file_path); | |
31 | |
32 PageState(); | |
33 | |
34 bool IsValid() const; | |
35 bool Equals(const PageState& page_state) const; | |
36 const std::string& ToEncodedData() const; | |
37 | |
38 std::vector<base::FilePath> GetReferencedFiles() const; | |
39 PageState RemovePasswordData() const; | |
40 PageState RemoveScrollOffset() const; | |
41 | |
42 private: | |
43 PageState(const std::string& data); | |
44 | |
45 std::string data_; | |
46 }; | |
tfarina
2013/05/16 22:16:48
DISALLOW_COPY_AND_ASSIGN?
| |
47 | |
48 // Support DCHECK_EQ(a, b), etc. | |
49 inline bool operator==(const PageState& a, const PageState& b) { | |
50 return a.Equals(b); | |
51 } | |
52 inline bool operator!=(const PageState& a, const PageState& b) { | |
53 return !(a == b); | |
54 } | |
55 | |
56 } // namespace content | |
57 | |
58 #endif // CONTENT_PUBLIC_COMMON_PAGE_STATE_H_ | |
OLD | NEW |