| 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 // HTTP page, or HTTPS page with no insecure content. | 40 NORMAL_CONTENT = 0, // No mixed content. |
| 41 NORMAL_CONTENT = 0, | 41 MIXED_CONTENT = 1 << 0, // https page containing http resources. |
| 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, | |
| 51 }; | 42 }; |
| 52 | 43 |
| 53 SSLStatus(); | 44 SSLStatus(); |
| 54 | 45 |
| 55 bool Equals(const SSLStatus& status) const { | 46 bool Equals(const SSLStatus& status) const { |
| 56 return security_style_ == status.security_style_ && | 47 return security_style_ == status.security_style_ && |
| 57 cert_id_ == status.cert_id_ && | 48 cert_id_ == status.cert_id_ && |
| 58 cert_status_ == status.cert_status_ && | 49 cert_status_ == status.cert_status_ && |
| 59 security_bits_ == status.security_bits_ && | 50 security_bits_ == status.security_bits_ && |
| 60 content_status_ == status.content_status_; | 51 content_status_ == status.content_status_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 81 return cert_status_; | 72 return cert_status_; |
| 82 } | 73 } |
| 83 | 74 |
| 84 void set_security_bits(int security_bits) { | 75 void set_security_bits(int security_bits) { |
| 85 security_bits_ = security_bits; | 76 security_bits_ = security_bits; |
| 86 } | 77 } |
| 87 int security_bits() const { | 78 int security_bits() const { |
| 88 return security_bits_; | 79 return security_bits_; |
| 89 } | 80 } |
| 90 | 81 |
| 91 void set_displayed_mixed_content() { | 82 // Mixed content means that this page which is served over https contains |
| 92 content_status_ |= DISPLAYED_MIXED_CONTENT; | 83 // http sub-resources. |
| 84 void set_has_mixed_content() { |
| 85 content_status_ |= MIXED_CONTENT; |
| 93 } | 86 } |
| 94 bool displayed_mixed_content() const { | 87 bool has_mixed_content() const { |
| 95 return (content_status_ & DISPLAYED_MIXED_CONTENT) != 0; | 88 return (content_status_ & 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; | |
| 103 } | 89 } |
| 104 | 90 |
| 105 // Raw accessors for all the content status flags. This contains a | 91 // Raw accessors for all the content status flags. This contains a |
| 106 // combination of any of the ContentStatusFlags defined above. It is used | 92 // combination of any of the ContentStatusFlags defined above. It is used |
| 107 // by some tests for checking and for certain copying. Use the per-status | 93 // by some tests for checking and for certain copying. Use the per-status |
| 108 // functions for normal usage. | 94 // functions for normal usage. |
| 109 void set_content_status(int content_status) { | 95 void set_content_status(int content_status) { |
| 110 content_status_ = content_status; | 96 content_status_ = content_status; |
| 111 } | 97 } |
| 112 int content_status() const { | 98 int content_status() const { |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // This is a cached version of the result of GetTitleForDisplay. It prevents | 407 // This is a cached version of the result of GetTitleForDisplay. It prevents |
| 422 // us from having to do URL formatting on the URL evey time the title is | 408 // us from having to do URL formatting on the URL evey time the title is |
| 423 // displayed. When the URL, virtual URL, or title is set, this should be | 409 // displayed. When the URL, virtual URL, or title is set, this should be |
| 424 // cleared to force a refresh. | 410 // cleared to force a refresh. |
| 425 string16 cached_display_title_; | 411 string16 cached_display_title_; |
| 426 | 412 |
| 427 // Copy and assignment is explicitly allowed for this class. | 413 // Copy and assignment is explicitly allowed for this class. |
| 428 }; | 414 }; |
| 429 | 415 |
| 430 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 416 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
| OLD | NEW |