OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
31 class NavigationEntry { | 31 class NavigationEntry { |
32 public: | 32 public: |
33 // SSL ----------------------------------------------------------------------- | 33 // SSL ----------------------------------------------------------------------- |
34 | 34 |
35 // Collects the SSL information for this NavigationEntry. | 35 // Collects the SSL information for this NavigationEntry. |
36 class SSLStatus { | 36 class SSLStatus { |
37 public: | 37 public: |
38 // Flags used for the page security content status. | 38 // Flags used for the page security content status. |
39 enum ContentStatusFlags { | 39 enum ContentStatusFlags { |
40 NORMAL_CONTENT = 0, // No mixed content. | 40 // HTTP page, or HTTPS page with no insecure content. |
41 MIXED_CONTENT = 1 << 0, // https page containing http resources. | 41 NORMAL_CONTENT = 0, |
| 42 |
| 43 // HTTPS page containing "displayed" HTTP resources (e.g. images, CSS). |
| 44 DISPLAYED_MIXED_CONTENT = 1 << 0, |
| 45 |
| 46 // HTTPS page containing "executed" HTTP resources (i.e. script). |
| 47 // Also currently used for HTTPS page containing broken-HTTPS resources; |
| 48 // this is wrong and should be fixed (see comments in |
| 49 // SSLPolicy::OnRequestStarted()). |
| 50 RAN_MIXED_CONTENT = 1 << 1, |
42 }; | 51 }; |
43 | 52 |
44 SSLStatus(); | 53 SSLStatus(); |
45 | 54 |
46 bool Equals(const SSLStatus& status) const { | 55 bool Equals(const SSLStatus& status) const { |
47 return security_style_ == status.security_style_ && | 56 return security_style_ == status.security_style_ && |
48 cert_id_ == status.cert_id_ && | 57 cert_id_ == status.cert_id_ && |
49 cert_status_ == status.cert_status_ && | 58 cert_status_ == status.cert_status_ && |
50 security_bits_ == status.security_bits_ && | 59 security_bits_ == status.security_bits_ && |
51 content_status_ == status.content_status_; | 60 content_status_ == status.content_status_; |
(...skipping 20 matching lines...) Expand all Loading... |
72 return cert_status_; | 81 return cert_status_; |
73 } | 82 } |
74 | 83 |
75 void set_security_bits(int security_bits) { | 84 void set_security_bits(int security_bits) { |
76 security_bits_ = security_bits; | 85 security_bits_ = security_bits; |
77 } | 86 } |
78 int security_bits() const { | 87 int security_bits() const { |
79 return security_bits_; | 88 return security_bits_; |
80 } | 89 } |
81 | 90 |
82 // Mixed content means that this page which is served over https contains | 91 void set_displayed_mixed_content() { |
83 // http sub-resources. | 92 content_status_ |= DISPLAYED_MIXED_CONTENT; |
84 void set_has_mixed_content() { | |
85 content_status_ |= MIXED_CONTENT; | |
86 } | 93 } |
87 bool has_mixed_content() const { | 94 bool displayed_mixed_content() const { |
88 return (content_status_ & MIXED_CONTENT) != 0; | 95 return (content_status_ & DISPLAYED_MIXED_CONTENT) != 0; |
| 96 } |
| 97 |
| 98 void set_ran_mixed_content() { |
| 99 content_status_ |= RAN_MIXED_CONTENT; |
| 100 } |
| 101 bool ran_mixed_content() const { |
| 102 return (content_status_ & RAN_MIXED_CONTENT) != 0; |
89 } | 103 } |
90 | 104 |
91 // Raw accessors for all the content status flags. This contains a | 105 // Raw accessors for all the content status flags. This contains a |
92 // combination of any of the ContentStatusFlags defined above. It is used | 106 // combination of any of the ContentStatusFlags defined above. It is used |
93 // by some tests for checking and for certain copying. Use the per-status | 107 // by some tests for checking and for certain copying. Use the per-status |
94 // functions for normal usage. | 108 // functions for normal usage. |
95 void set_content_status(int content_status) { | 109 void set_content_status(int content_status) { |
96 content_status_ = content_status; | 110 content_status_ = content_status; |
97 } | 111 } |
98 int content_status() const { | 112 int content_status() const { |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // This is a cached version of the result of GetTitleForDisplay. It prevents | 421 // This is a cached version of the result of GetTitleForDisplay. It prevents |
408 // us from having to do URL formatting on the URL evey time the title is | 422 // us from having to do URL formatting on the URL evey time the title is |
409 // displayed. When the URL, virtual URL, or title is set, this should be | 423 // displayed. When the URL, virtual URL, or title is set, this should be |
410 // cleared to force a refresh. | 424 // cleared to force a refresh. |
411 string16 cached_display_title_; | 425 string16 cached_display_title_; |
412 | 426 |
413 // Copy and assignment is explicitly allowed for this class. | 427 // Copy and assignment is explicitly allowed for this class. |
414 }; | 428 }; |
415 | 429 |
416 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 430 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
OLD | NEW |