Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1549)

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list_fast_enumeration_helper.h

Issue 2680403005: Introduce WebStateList to manage a list of web::WebState. (Closed)
Patch Set: Rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698