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 | |
11 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
12 #error "This file requires ARC support." | |
marq (ping after 24h)
2017/01/13 10:38:17
Here, too.
stkhapugin
2017/01/17 15:57:44
Surely twice is the right amount.
| |
13 #endif | |
14 | |
7 ContextualSearchWebStateObserver::ContextualSearchWebStateObserver( | 15 ContextualSearchWebStateObserver::ContextualSearchWebStateObserver( |
8 id<ContextualSearchWebStateDelegate> delegate) | 16 id<ContextualSearchWebStateDelegate> delegate) |
9 : web::WebStateObserver(), delegate_(delegate), loaded_(false) {} | 17 : web::WebStateObserver(), delegate_(delegate), loaded_(false) {} |
10 | 18 |
11 ContextualSearchWebStateObserver::~ContextualSearchWebStateObserver() {} | 19 ContextualSearchWebStateObserver::~ContextualSearchWebStateObserver() {} |
12 | 20 |
13 void ContextualSearchWebStateObserver::ObserveWebState( | 21 void ContextualSearchWebStateObserver::ObserveWebState( |
14 web::WebState* web_state) { | 22 web::WebState* web_state) { |
15 loaded_ = false; | 23 loaded_ = false; |
16 Observe(web_state); | 24 Observe(web_state); |
(...skipping 15 matching lines...) Expand all Loading... | |
32 pageLoadedWithStatus:load_completion_status]; | 40 pageLoadedWithStatus:load_completion_status]; |
33 } | 41 } |
34 loaded_ = true; | 42 loaded_ = true; |
35 } | 43 } |
36 | 44 |
37 void ContextualSearchWebStateObserver::WebStateDestroyed() { | 45 void ContextualSearchWebStateObserver::WebStateDestroyed() { |
38 if ([delegate_ respondsToSelector:@selector(webStateDestroyed:)]) { | 46 if ([delegate_ respondsToSelector:@selector(webStateDestroyed:)]) { |
39 [delegate_ webStateDestroyed:web_state()]; | 47 [delegate_ webStateDestroyed:web_state()]; |
40 } | 48 } |
41 } | 49 } |
OLD | NEW |