OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <list> | 6 #include <list> |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 class InterstitialObserver : public content::WebContentsObserver { | 89 class InterstitialObserver : public content::WebContentsObserver { |
90 public: | 90 public: |
91 InterstitialObserver(content::WebContents* web_contents, | 91 InterstitialObserver(content::WebContents* web_contents, |
92 const base::Closure& attach_callback, | 92 const base::Closure& attach_callback, |
93 const base::Closure& detach_callback) | 93 const base::Closure& detach_callback) |
94 : WebContentsObserver(web_contents), | 94 : WebContentsObserver(web_contents), |
95 attach_callback_(attach_callback), | 95 attach_callback_(attach_callback), |
96 detach_callback_(detach_callback) { | 96 detach_callback_(detach_callback) { |
97 } | 97 } |
98 | 98 |
99 virtual void DidAttachInterstitialPage() OVERRIDE { | 99 virtual void DidAttachInterstitialPage() override { |
100 attach_callback_.Run(); | 100 attach_callback_.Run(); |
101 } | 101 } |
102 | 102 |
103 virtual void DidDetachInterstitialPage() OVERRIDE { | 103 virtual void DidDetachInterstitialPage() override { |
104 detach_callback_.Run(); | 104 detach_callback_.Run(); |
105 } | 105 } |
106 | 106 |
107 private: | 107 private: |
108 base::Closure attach_callback_; | 108 base::Closure attach_callback_; |
109 base::Closure detach_callback_; | 109 base::Closure detach_callback_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(InterstitialObserver); | 111 DISALLOW_COPY_AND_ASSIGN(InterstitialObserver); |
112 }; | 112 }; |
113 | 113 |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 loop_runner->QuitClosure()); | 1301 loop_runner->QuitClosure()); |
1302 handler->CancelAuth(); | 1302 handler->CancelAuth(); |
1303 if (content::InterstitialPage::GetInterstitialPage(contents)) | 1303 if (content::InterstitialPage::GetInterstitialPage(contents)) |
1304 loop_runner->Run(); | 1304 loop_runner->Run(); |
1305 EXPECT_EQ("127.0.0.1", contents->GetVisibleURL().host()); | 1305 EXPECT_EQ("127.0.0.1", contents->GetVisibleURL().host()); |
1306 EXPECT_FALSE(contents->ShowingInterstitialPage()); | 1306 EXPECT_FALSE(contents->ShowingInterstitialPage()); |
1307 } | 1307 } |
1308 } | 1308 } |
1309 | 1309 |
1310 } // namespace | 1310 } // namespace |
OLD | NEW |