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/chrome/browser/ui/contextual_search/contextual_search_web_state_ob
server.h" | 5 #include "ios/chrome/browser/ui/contextual_search/contextual_search_web_state_ob
server.h" |
6 | 6 |
| 7 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 8 #error "This file requires ARC support." |
| 9 #endif |
| 10 |
7 ContextualSearchWebStateObserver::ContextualSearchWebStateObserver( | 11 ContextualSearchWebStateObserver::ContextualSearchWebStateObserver( |
8 id<ContextualSearchWebStateDelegate> delegate) | 12 id<ContextualSearchWebStateDelegate> delegate) |
9 : web::WebStateObserver(), delegate_(delegate), loaded_(false) {} | 13 : web::WebStateObserver(), delegate_(delegate), loaded_(false) {} |
10 | 14 |
11 ContextualSearchWebStateObserver::~ContextualSearchWebStateObserver() {} | 15 ContextualSearchWebStateObserver::~ContextualSearchWebStateObserver() {} |
12 | 16 |
13 void ContextualSearchWebStateObserver::ObserveWebState( | 17 void ContextualSearchWebStateObserver::ObserveWebState( |
14 web::WebState* web_state) { | 18 web::WebState* web_state) { |
15 loaded_ = false; | 19 loaded_ = false; |
16 Observe(web_state); | 20 Observe(web_state); |
(...skipping 15 matching lines...) Expand all Loading... |
32 pageLoadedWithStatus:load_completion_status]; | 36 pageLoadedWithStatus:load_completion_status]; |
33 } | 37 } |
34 loaded_ = true; | 38 loaded_ = true; |
35 } | 39 } |
36 | 40 |
37 void ContextualSearchWebStateObserver::WebStateDestroyed() { | 41 void ContextualSearchWebStateObserver::WebStateDestroyed() { |
38 if ([delegate_ respondsToSelector:@selector(webStateDestroyed:)]) { | 42 if ([delegate_ respondsToSelector:@selector(webStateDestroyed:)]) { |
39 [delegate_ webStateDestroyed:web_state()]; | 43 [delegate_ webStateDestroyed:web_state()]; |
40 } | 44 } |
41 } | 45 } |
OLD | NEW |