| OLD | NEW |
| 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 #include "content/browser/ssl/ssl_manager.h" | 5 #include "content/browser/ssl/ssl_manager.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "content/browser/site_instance_impl.h" | 8 #include "content/browser/site_instance_impl.h" |
| 9 #include "content/public/browser/ssl_status.h" | 9 #include "content/public/browser/ssl_status.h" |
| 10 #include "content/public/browser/web_contents_delegate.h" | 10 #include "content/public/browser/web_contents_delegate.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // A WebContentsDelegate that exposes the visible SSLStatus at the time | 21 // A WebContentsDelegate that exposes the visible SSLStatus at the time |
| 22 // of the last VisibleSSLStateChanged() call. | 22 // of the last VisibleSSLStateChanged() call. |
| 23 class TestWebContentsDelegate : public WebContentsDelegate { | 23 class TestWebContentsDelegate : public WebContentsDelegate { |
| 24 public: | 24 public: |
| 25 TestWebContentsDelegate() : WebContentsDelegate() {} | 25 TestWebContentsDelegate() : WebContentsDelegate() {} |
| 26 ~TestWebContentsDelegate() override {} | 26 ~TestWebContentsDelegate() override {} |
| 27 | 27 |
| 28 const SSLStatus& last_ssl_state() { return last_ssl_state_; } | 28 const SSLStatus& last_ssl_state() { return last_ssl_state_; } |
| 29 | 29 |
| 30 // WebContentsDelegate: | 30 // WebContentsDelegate: |
| 31 void VisibleSSLStateChanged(const WebContents* source) override { | 31 void VisibleSSLStateChanged(WebContents* source) override { |
| 32 NavigationEntry* entry = source->GetController().GetVisibleEntry(); | 32 NavigationEntry* entry = source->GetController().GetVisibleEntry(); |
| 33 EXPECT_TRUE(entry); | 33 EXPECT_TRUE(entry); |
| 34 last_ssl_state_ = entry->GetSSL(); | 34 last_ssl_state_ = entry->GetSSL(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 SSLStatus last_ssl_state_; | 38 SSLStatus last_ssl_state_; |
| 39 DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate); | 39 DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate); |
| 40 }; | 40 }; |
| 41 | 41 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 web_contents()->OnCreditCardInputShownOnHttp(); | 97 web_contents()->OnCreditCardInputShownOnHttp(); |
| 98 EXPECT_TRUE(delegate.last_ssl_state().content_status & | 98 EXPECT_TRUE(delegate.last_ssl_state().content_status & |
| 99 SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP); | 99 SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP); |
| 100 EXPECT_TRUE(delegate.last_ssl_state().content_status & | 100 EXPECT_TRUE(delegate.last_ssl_state().content_status & |
| 101 SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP); | 101 SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP); |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 } // namespace content | 106 } // namespace content |
| OLD | NEW |