OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #import "ios/shared/chrome/browser/tabs/web_state_list_observer_bridge.h" | 5 #import "ios/shared/chrome/browser/tabs/web_state_list_observer_bridge.h" |
6 | 6 |
7 #if !defined(__has_feature) || !__has_feature(objc_arc) | 7 #if !defined(__has_feature) || !__has_feature(objc_arc) |
8 #error "This file requires ARC support." | 8 #error "This file requires ARC support." |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 web::WebState* web_state, | 63 web::WebState* web_state, |
64 int index) { | 64 int index) { |
65 const SEL selector = @selector(webStateList:didDetachWebState:atIndex:); | 65 const SEL selector = @selector(webStateList:didDetachWebState:atIndex:); |
66 if (![observer_ respondsToSelector:selector]) | 66 if (![observer_ respondsToSelector:selector]) |
67 return; | 67 return; |
68 | 68 |
69 [observer_ webStateList:web_state_list | 69 [observer_ webStateList:web_state_list |
70 didDetachWebState:web_state | 70 didDetachWebState:web_state |
71 atIndex:index]; | 71 atIndex:index]; |
72 } | 72 } |
| 73 |
| 74 void WebStateListObserverBridge::WebStateActivatedAt( |
| 75 WebStateList* web_state_list, |
| 76 web::WebState* old_web_state, |
| 77 web::WebState* new_web_state, |
| 78 int active_index, |
| 79 bool user_action) { |
| 80 const SEL selector = @selector |
| 81 (webStateList:didChangeActiveWebState:oldWebState:atIndex:userAction:); |
| 82 if (![observer_ respondsToSelector:selector]) |
| 83 return; |
| 84 |
| 85 [observer_ webStateList:web_state_list |
| 86 didChangeActiveWebState:new_web_state |
| 87 oldWebState:old_web_state |
| 88 atIndex:active_index |
| 89 userAction:(user_action ? YES : NO)]; |
| 90 } |
OLD | NEW |