Index: ios/shared/chrome/browser/tabs/web_state_list_fast_enumeration_helper.h |
diff --git a/ios/shared/chrome/browser/tabs/web_state_list_fast_enumeration_helper.h b/ios/shared/chrome/browser/tabs/web_state_list_fast_enumeration_helper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fca94d79b91f8882e3727e2c83948304b02f0a8a |
--- /dev/null |
+++ b/ios/shared/chrome/browser/tabs/web_state_list_fast_enumeration_helper.h |
@@ -0,0 +1,35 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_FAST_ENUMERATION_HELPER_H_ |
+#define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_FAST_ENUMERATION_HELPER_H_ |
+ |
+#import <Foundation/Foundation.h> |
+ |
+class WebStateList; |
+ |
+namespace web { |
+class WebState; |
+} |
+ |
+// Protocol used to get Objective-C proxies for WebStates. |
+@protocol WebStateProxyFactory |
+ |
+// Returns an Objective-C object corresponding to a given WebState. |
+- (id)proxyForWebState:(web::WebState*)webState; |
+ |
+@end |
+ |
+// Helper class allowing NSFastEnumeration over a WebStateList. |
+@interface WebStateListFastEnumerationHelper : NSObject<NSFastEnumeration> |
+ |
+- (instancetype)initWithWebStateList:(WebStateList*)webStateList |
+ proxyFactory:(id<WebStateProxyFactory>)proxyFactory |
+ NS_DESIGNATED_INITIALIZER; |
+ |
+- (instancetype)init NS_UNAVAILABLE; |
+ |
+@end |
+ |
+#endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_FAST_ENUMERATION_HELPER_H_ |