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 "ios/web/public/test/test_redirect_observer.h" | 5 #include "ios/web/public/test/test_redirect_observer.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
9 #import "ios/web/public/navigation_item.h" | 9 #import "ios/web/public/navigation_item.h" |
10 #import "ios/web/public/navigation_manager.h" | 10 #import "ios/web/public/navigation_manager.h" |
11 #include "ios/web/public/web_state/navigation_context.h" | 11 #include "ios/web/public/web_state/navigation_context.h" |
12 #import "ios/web/public/web_state/web_state.h" | 12 #import "ios/web/public/web_state/web_state.h" |
13 | 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
14 namespace { | 18 namespace { |
15 // The key under which TestRedirectObservers are stored in a WebState's user | 19 // The key under which TestRedirectObservers are stored in a WebState's user |
16 // data. | 20 // data. |
17 const void* const kTestRedirectObserverKey = &kTestRedirectObserverKey; | 21 const void* const kTestRedirectObserverKey = &kTestRedirectObserverKey; |
18 } // namespace | 22 } // namespace |
19 | 23 |
20 namespace web { | 24 namespace web { |
21 | 25 |
22 #pragma mark - TestRedirectObserverUserDataWrapper | 26 #pragma mark - TestRedirectObserverUserDataWrapper |
23 | 27 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // chain for that NavigationItem. | 94 // chain for that NavigationItem. |
91 expected_urls_.erase(url); | 95 expected_urls_.erase(url); |
92 RedirectChain redirect_chain; | 96 RedirectChain redirect_chain; |
93 redirect_chain.original_url = url; | 97 redirect_chain.original_url = url; |
94 redirect_chain.final_url = url; | 98 redirect_chain.final_url = url; |
95 redirect_chains_[item] = redirect_chain; | 99 redirect_chains_[item] = redirect_chain; |
96 } | 100 } |
97 } | 101 } |
98 | 102 |
99 } // namespace web | 103 } // namespace web |
OLD | NEW |